Skip to content

Commit 6e79c03

Browse files
Not-Nikclaude
andcommitted
Fetch latest tag via gh API in semver workflow
The semver action does its own full checkout, so the calling workflow doesn't need one. Use `gh api` to fetch the latest tag instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5a84b86 commit 6e79c03

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

.github/workflows/semver.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ jobs:
2020
run:
2121
shell: bash
2222
steps:
23-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24-
with:
25-
persist-credentials: false
26-
fetch-depth: 0
27-
2823
- name: Get latest tag
2924
id: tag
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3027
run: |
31-
echo "ref=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
28+
echo "ref=$(gh api "repos/$GITHUB_REPOSITORY/tags" --jq '.[0].name')" >> "$GITHUB_OUTPUT"
3229
3330
- uses: mozilla/actions/nss@25cb84d060946c0ad6d2c3f79da479b16d180d71 # v1.1.0
3431
with:

0 commit comments

Comments
 (0)