Skip to content

Commit

Permalink
CI Add validation for branch input (#742)
Browse files Browse the repository at this point in the history
* CI Add validation for branch input

* filter event

* fix syntax
  • Loading branch information
samarsault committed May 4, 2023
1 parent cb46255 commit 67f1b08
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
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 67f1b08

Please sign in to comment.