Skip to content

Commit

Permalink
chore: add a step to validate branch name in Build Artifacts for PRs …
Browse files Browse the repository at this point in the history
…workflow
  • Loading branch information
sandeepdsvs committed Jul 16, 2024
1 parent decbd40 commit 22c6d9e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build-pr-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1

- name: Validate Branch Name
id: validate_branch_name
run: |
# Perform input validation here
# For example, check for forbidden characters
if [[ "${{ github.head_ref }}" =~ [^a-zA-Z0-9._-] ]]; then
echo "Error: Branch name contains invalid characters."
exit 1
fi
# Replace problematic characters in branch name (like '/') with safe characters (like '.')
- name: Generate Tag Names
id: gen_tag_names
Expand Down

0 comments on commit 22c6d9e

Please sign in to comment.