Skip to content

Commit

Permalink
Sync by bot
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteLegendBot committed Jun 12, 2023
1 parent 234a036 commit 8e633c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
persist-credentials: false
ref: main
fetch-depth: 0
- name: Validate PR branch name
uses: actions/github-script@v5
with:
script: |
const branchName = context.payload.pull_request.head.ref;
if (!/^[\w/-]*$/.test(branchName)) {
throw new Error(`Invalid branch name: ${branchName}`);
}
- name: Checkout PR branch
run: |
git remote add pr ${{ github.event.pull_request.head.repo.html_url }}
Expand Down

0 comments on commit 8e633c5

Please sign in to comment.