Skip to content

Commit f2a306b

Browse files
committed
Only tag latest if we’re the latest
1 parent ab3d8f7 commit f2a306b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/cd.vx.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ permissions:
1313
contents: write
1414

1515
jobs:
16-
retag:
16+
vtagger:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: fischerscode/tagger@v0
2121
with:
2222
prefix: v
2323
- run: |
24-
git tag -f latest
25-
git push origin latest --force
24+
latest_release=$(curl -s \
25+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
26+
-H "Accept: application/vnd.github+json" \
27+
https://api.github.com/repos/${{ github.repository }}/releases/latest \
28+
| jq -r '.tag_name')
29+
30+
if [ "${latest_release}" = "${{ github.event.release.tag_name }}" ]; then
31+
git tag -f latest
32+
git push origin latest --force
33+
fi

0 commit comments

Comments
 (0)