Skip to content

Commit 0ecb443

Browse files
committed
chore: reconstruct tags and validate inputs
Signed-off-by: Frank Kong <frkong@redhat.com>
1 parent 5c1f793 commit 0ecb443

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/pr-publish.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ jobs:
7979
echo "Error: Invalid all_tags format: $ALL_TAGS"
8080
exit 1
8181
fi
82-
82+
# Reconstruct them from the validated PR_NUMBER/SHORT_SHA so this privileged
83+
PRIMARY_TAG="pr-${PR_NUMBER}"
84+
ALL_TAGS="${PRIMARY_TAG},pr-${PR_NUMBER}-${SHORT_SHA}"
8385
BUILD_SKIPPED=$(jq -r '.build_skipped // "false"' /tmp/pr-metadata/pr-info.json)
8486
87+
if ! [[ "$BUILD_SKIPPED" =~ ^(true|false)$ ]]; then
88+
echo "Error: Invalid build_skipped value: $BUILD_SKIPPED"
89+
exit 1
90+
fi
91+
8592
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
8693
echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT
8794
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)