Skip to content

Commit

Permalink
CI Add validation for branch input (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
samarsault authored May 10, 2023
1 parent ed8456a commit 6f28ed9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ jobs:
node: [14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
text: ${{ github.event.inputs.branch }}
regex: '^[a-zA-Z0-9_/\-]+$'
- name: Break on invalid branch name
run: exit 1
if: ${{ github.event_name == 'workflow_dispatch' && steps.regex-match.outputs && steps.regex-match.outputs.match == '' }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
Expand Down

0 comments on commit 6f28ed9

Please sign in to comment.