Skip to content

Commit cc16095

Browse files
committed
ci: need the release tag sha, not branch head
1 parent 9b1872b commit cc16095

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/release-drafter.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,14 @@ jobs:
250250
env:
251251
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
252252

253-
- name: Download all release artifacts
253+
- name: Download all release artifacts
254254
run: |
255255
TAG="${{ needs.check-tag.outputs.tag_name }}"
256256
257-
# Get the commit SHA for this tag from GitHub API or current HEAD
258-
COMMIT_SHA="${{ github.event.workflow_run.head_sha || github.sha }}"
259-
echo "Looking for artifacts from commit: $COMMIT_SHA"
257+
# Get the commit SHA for this tag from GitHub API
258+
COMMIT_SHA=$(gh api repos/${{ github.repository }}/git/ref/tags/${TAG#v} --jq '.object.sha' 2>/dev/null || \
259+
gh api repos/${{ github.repository }}/git/ref/tags/$TAG --jq '.object.sha')
260+
echo "Tag $TAG points to commit: $COMMIT_SHA"
260261
261262
# Find all successful workflow runs for this commit
262263
WORKFLOW_RUNS=$(gh run list --commit $COMMIT_SHA --json databaseId,status,conclusion --jq '.[] | select(.conclusion=="success") | .databaseId')

0 commit comments

Comments
 (0)