Skip to content

Fix publish-release: getReleaseByTag does not return drafts#8

Merged
JE-Chen merged 1 commit into
mainfrom
dev
May 17, 2026
Merged

Fix publish-release: getReleaseByTag does not return drafts#8
JE-Chen merged 1 commit into
mainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented May 17, 2026

Summary

Single-commit fix (3453c02) for the publish-release job's 404 on v0.1.6.

What broke

publish-release called github.rest.repos.getReleaseByTag(tag='v0.1.6') and got HTTP 404 even though the draft release existed. Per GitHub's docs:

"You cannot get a draft release by its tag name."

The whole point of the create-draft → build-nuitka → publish-release pattern is that the release IS still a draft when publish-release fires — so the lookup it relied on explicitly excludes the only thing we care about.

Fix

Switch to github.paginate(github.rest.repos.listReleases) (which DOES include drafts) and find by tag_name. Error message now includes the actual list of existing tag names so a future tag mismatch is easy to diagnose.

Out-of-band cleanup

Applied manually so the user could see the release immediately:

  • v0.1.6 unmarked draft → now Latest in the sidebar with autopapertoppt-windows-x86_64.zip + .sha256 attached
  • v0.1.3 / v0.1.4 / v0.1.5 drafts deleted (their builds had failed at earlier stages; PyPI versions stand)

Test plan

  • CI passes
  • On merge: auto-bump to v0.1.7 → publish-pypi → draft created → Nuitka build → publish-release succeeds via the new listReleases lookup → v0.1.7 shows up in the sidebar without manual intervention

The publish-release job's actions/github-script step called
github.rest.repos.getReleaseByTag(tag='v0.1.6') and got HTTP 404
even though the draft release existed. Root cause: per
https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name
'You cannot get a draft release by its tag name.'

The whole point of the create-draft -> build-nuitka -> publish-release
pattern is that the release IS still a draft when publish-release
fires; the entire pipeline broke because the lookup it relies on
explicitly excludes drafts.

Switch to github.paginate(github.rest.repos.listReleases) (which
DOES include drafts) and find() by tag_name. Error message now
includes the actual list of existing tag names so a future
mismatch is easy to diagnose.

Cleanup applied out-of-band:
- v0.1.6 unmarked draft manually so it surfaces in the sidebar.
- v0.1.3 / v0.1.4 / v0.1.5 drafts deleted (their corresponding
  builds had failed at earlier stages; the PyPI versions stand
  but the GitHub releases were stale).
@JE-Chen JE-Chen merged commit da841db into main May 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant