Skip to content

Commit

Permalink
chore(release): check tag name and print if erroneous
Browse files Browse the repository at this point in the history
[no-jira]
  • Loading branch information
chris-asl committed Sep 19, 2023
1 parent 9c10c1a commit 067415e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Check tag name pattern follows `vX.Y.Z`
run: |
if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag name ($GITHUB_REF) does not match the pattern 'vX.Y.Z'. Exiting."
exit 0
fi
- name: Issue a release only if a tag is based on a merged commit in `main` branch
run: |
git fetch main
tag_commit=$(git rev-parse ${{ github.ref }})
merged_commit=$(git rev-parse main)
Expand All @@ -25,13 +34,6 @@ jobs:
exit 0
fi
- name: Check tag name pattern follows `vX.Y.Z`
run: |
if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag name does not match the pattern 'vX.Y.Z'. Exiting."
exit 0
fi
- name: Setup Java
uses: actions/setup-java@v3
with:
Expand Down

0 comments on commit 067415e

Please sign in to comment.