Skip to content

Commit 16dc384

Browse files
committed
Tag the dispatched sha in release-draft, not the checkout HEAD
The release tag must point at the commit the artifacts were built from (github.sha). The step tagged whatever the job checkout resolved to - the branch head at job START - so a commit pushed to main mid-run moved the tag target; when that head commit happened to touch .github/workflows/, the GitHub App token's tag push was rejected outright (refusing to create refs at workflow-modifying commits), failing the 0.8.0 draft.
1 parent 3bbb6bb commit 16dc384

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,13 @@ jobs:
148148
- name: Create tag
149149
env:
150150
VERSION: ${{ inputs.version }}
151+
# Tag the DISPATCHED sha, not the checkout HEAD: the artifacts were
152+
# built from github.sha, and a commit pushed to main mid-run must not
153+
# move the release tag. (A floating HEAD also broke the 0.8.0 release:
154+
# HEAD had become a commit touching .github/workflows/, and the App
155+
# token may not create refs pointing at workflow-modifying commits.)
151156
run: |
152-
git tag -f "$VERSION"
157+
git tag -f "$VERSION" "$GITHUB_SHA"
153158
git push origin "$VERSION" --force
154159
155160
- uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v2

0 commit comments

Comments
 (0)