Skip to content

Commit

Permalink
CI Add validation for branch input (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
samarsault committed May 10, 2023
1 parent ce2211b commit fddf36d
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 @@ -14,6 +14,15 @@ jobs:
name: Test
runs-on: ubuntu-latest
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-dotnet@v3
with:
Expand Down

0 comments on commit fddf36d

Please sign in to comment.