diff --git a/.github/workflows/build-pr-artifacts.yml b/.github/workflows/build-pr-artifacts.yml index 8e8554e..eb5dfc3 100644 --- a/.github/workflows/build-pr-artifacts.yml +++ b/.github/workflows/build-pr-artifacts.yml @@ -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