Skip to content

Commit 39aed9d

Browse files
build: run release if we are in a version tag (#353)
Co-authored-by: chris <[email protected]>
1 parent c5bb810 commit 39aed9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/scripts/release.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ if [[ "$GITHUB_BASE_REF" != "" ]]; then
2626
fi
2727

2828
EXPECTED_REF="refs/heads/${BRANCH}"
29+
EXPECTED_TAG_REF_REGEX="^refs/tags/v.*$"
2930

3031
if [[ "$GITHUB_REPOSITORY" != "$REPO" ]]; then
3132
echo "Skipping release: wrong repository. Expected '$REPO' but was '$GITHUB_REPOSITORY'."
3233
elif [[ "$IS_PULL_REQUEST" != "false" ]]; then
3334
echo "Skipping release. It was pull request."
34-
elif [[ "$GITHUB_REF" != "$EXPECTED_REF" ]]; then
35-
echo "Skipping release. Expected '$EXPECTED_REF' but was '$GITHUB_REF'."
35+
elif [[ "$GITHUB_REF" != "$EXPECTED_REF" && ! "$GITHUB_REF" =~ $EXPECTED_TAG_REF_REGEX ]]; then
36+
echo "Skipping release. Expected '$EXPECTED_REF' or a version tag, but was '$GITHUB_REF'."
3637
elif [[ -z $VERSION ]]; then
3738
echo "Skipping release. Version value not found."
3839
elif ! [[ $VERSION =~ $SEMVER_REGEX ]]; then

0 commit comments

Comments
 (0)