Skip to content

Commit 77e6dd3

Browse files
Correct the validation for tag and branch
1 parent 4695b72 commit 77e6dd3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
echo "Tag $VERSION_NUM follows valid semantic version pattern"
3535
3636
# Verify release tag is made on the correct major.minor version branch.
37-
# The command will fail with exit code 1 if the tag is not on a valid release branch.
3837
MAJOR_MINOR=$(echo "$VERSION_NUM" | cut -d'.' -f1,2)
39-
git branch --remote --contains $COMMIT_SHA origin/$MAJOR_MINOR
40-
38+
BRANCH_CONTAINS_OUTPUT=$(git branch --remote --contains "$COMMIT_SHA" "origin/$MAJOR_MINOR")
39+
if [ -z "$BRANCH_CONTAINS_OUTPUT" ]; then
40+
echo "Tag $VERSION_NUM is not on the correct branch. Skipping release."
41+
exit 78
42+
fi
4143
echo "Tag is from a valid branch."
42-
echo "test"
4344
4445
- name: Download sagemaker artifacts by commit ID
4546
run: |

0 commit comments

Comments
 (0)