Skip to content

Commit

Permalink
Add workaround for release publishing action mishandling `draft: true…
Browse files Browse the repository at this point in the history
…` -> `false` transition (#444)

This works around `softprops/action-gh-release` not being able to
properly "publish" a release by changing `draft: true` to `draft:
false`.

The intention is that the step with `draft: false` would find the
existing draft release and update it (publishing it). This is what
correctly happened for a testing `v0.12.3-beta.3` release from this
branch:
https://github.com/pantsbuild/scie-pants/releases/tag/v0.12.3-beta.3 (I
also did attempted a `v0.12.3-beta.2` from this branch, but that used a
newer version of the action code and failed completely, see below.)

Previously, the action would fail to find the existing draft release and
instead create a duplicate one. The old behaviour is visible (to people
who can see draft releases) with `v0.12.3-beta.0` and `-beta.1`.

The particular new version of the action is:

- changes:
softprops/action-gh-release@master...huonw:action-gh-release:huonw/pantsbuild-fix-see-scie-pants-439
(specifically commit
huonw/action-gh-release@998f80d
from branch
https://github.com/huonw/action-gh-release/commits/huonw/pantsbuild-fix-see-scie-pants-439
)
- this is v2.0.9 (the current `v2` tag) with
softprops/action-gh-release#316 merged in
- using v2.2.0 (the latest version of the action) fails while uploading
artifacts with errors like `Request body length does not match
content-length header`, so this sticks with the older version.
  • Loading branch information
huonw authored Dec 12, 2024
1 parent 62894d0 commit 9d73b15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ jobs:
# Build up a draft release with the artifacts from each of these jobs:
- name: Create ${{ needs.determine-tag.outputs.release-tag }} Release
uses: softprops/action-gh-release@v2
# Need to pull in https://github.com/softprops/action-gh-release/pull/316 to work-around
# double-release-creation that happens when attempting to update a draft release to
# not-draft.
uses: huonw/action-gh-release@998f80d5380609557d7464b01d59a10d845600a0 # v2.0.9 (v2) + https://github.com/softprops/action-gh-release/pull/316
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -131,7 +134,8 @@ jobs:
setup-python: true

- name: Publish ${{ needs.determine-tag.outputs.release-tag }} Release
uses: softprops/action-gh-release@v2
# See above for discussion:
uses: huonw/action-gh-release@998f80d5380609557d7464b01d59a10d845600a0 # v2.0.9 (v2) + https://github.com/softprops/action-gh-release/pull/316
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down

0 comments on commit 9d73b15

Please sign in to comment.