Skip to content

Commit 73a1e6b

Browse files
fix(ci): validate version input in workflow_dispatch
1 parent 5dd5b00 commit 73a1e6b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ jobs:
5757
echo "Stable release: $VERSION (from tag $TAG)"
5858
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
5959
VERSION="${{ inputs.version }}"
60+
VERSION="${VERSION#v}"
61+
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
62+
echo "::error::Invalid version '$VERSION'. Expected semver (e.g. 2.1.0)."
63+
exit 1
64+
fi
6065
NPM_TAG="latest"
6166
echo "Stable release (manual retry): $VERSION"
6267
else

0 commit comments

Comments
 (0)