Skip to content

Commit

Permalink
Merge pull request #22 from bluegroundltd/chore/fix-release-fetch-all…
Browse files Browse the repository at this point in the history
…-refs-tags

chore(release): fetch all refs to validate commit on `main`
  • Loading branch information
chris-asl authored Dec 1, 2023
2 parents 872ca9e + 20d3bb8 commit 5f2f505
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# https://github.com/actions/checkout?tab=readme-ov-file#Fetch-all-history-for-all-tags-and-branches
fetch-depth: 0
ref: ${{ github.ref }}

- name: Check tag name pattern follows `vX.Y.Z`
Expand All @@ -23,9 +25,7 @@ jobs:
- name: Issue a release only if a tag is based on a merged commit in `main` branch
run: |
tag_commit=$(git rev-parse ${{ github.ref }})
git fetch -f origin main
merged_commit=$(git rev-parse main)
merged_commit=$(git rev-parse origin/main)
if git merge-base --is-ancestor $tag_commit $merged_commit; then
echo "Tag is based on a merged commit in the main branch"
Expand Down

0 comments on commit 5f2f505

Please sign in to comment.