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 (#153)
  • Loading branch information
sandeepdsvs authored Aug 22, 2024
1 parent 53c1c0b commit 4124363
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 @@ -18,6 +18,16 @@ jobs:
uses: actions/checkout@v4.1.1
with:
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
Expand Down

0 comments on commit 4124363

Please sign in to comment.