Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
VERSION=$(echo "$BASENAME" | cut -d- -f2)
TAG="${NAME}-v${VERSION}"

# Validate NAME and VERSION to prevent unexpected values from flowing into git commands
if [[ ! "$NAME" =~ ^[a-zA-Z0-9_-]+$ ]] || [[ ! "$VERSION" =~ ^[0-9a-zA-Z._-]+$ ]]; then
echo "::error::Unexpected wheel name/version format in '${BASENAME}' — skipping." >&2
continue
fi

# Skip if tag already exists
if git rev-parse "refs/tags/${TAG}" >/dev/null 2>&1; then
echo "::notice::Tag ${TAG} already exists — skipping."
Expand Down