Skip to content

Commit 91a8a5e

Browse files
committed
sanitize branch name
1 parent cf90183 commit 91a8a5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/delete-pr-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
run: |
2020
BRANCH="${{ github.event.pull_request.head.ref }}"
2121
TAG="${BRANCH//\//_}"
22+
if ! [[ $TAG =~ ^[A-Za-z0-9._-]+$ ]]; then
23+
echo "Exiting - Manages branches only if they contain letters, numbers and the following special characters: . - _"
24+
exit 1
25+
fi
2226
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
2327
2428
- name: Delete image by tag from GHCR

0 commit comments

Comments
 (0)