Skip to content

ci: draft a GitHub Release when a v* tag is pushed - #119

Merged
drevendev merged 1 commit into
masterfrom
beautifulrepo/release-drafts-20261023
Oct 23, 2026
Merged

drevendev merged 1 commit into
masterfrom
beautifulrepo/release-drafts-20261023

Conversation

@drevendev

Copy link
Copy Markdown
Owner

Reader problem and change

v0.1.0 was cut by hand. The tag commit, the CI run on it, the SHA in the notes and the SHA in the adoption guide were all copied manually. Adopters pin that SHA, so one typo ships broken instructions.

.github/workflows/release.yml runs when a v* tag is pushed:

  1. It refuses a tag whose commit is not on master.
  2. It refuses a commit unless every required check named by the master ruleset passed on it. The ruleset is read through the API, so the list lives in one place.
  3. It opens a draft release from templates/RELEASE_NOTES.template.md, filling in the tag, full SHA, previous tag, compare link, changelog link and CI run. Every prose placeholder stays for a human.

It never publishes, never edits an existing release, writes only contents, and passes every input through env.

guides/maintenance-workflow.md gains a "Cut a release" section covering the changelog rename, version bump, tagging the green commit (tags can't be moved), the draft, publishing, and the follow-up pin PR.

Closes #56

Evidence

A dry run of the three step scripts, extracted from the workflow file, against v0.1.0 with real API calls:

  • v0.1.0 -> 96e04e6… (on master);
  • ok: for all five required checks;
  • notes filled with the SHA, the CI run URL, Compared from: the first commit and the changelog link.

Only gh release create was replaced by echo.

Verification

  • The five local checks passed on Windows 11 with Python 3.14.7: catalog OK; docs links 195; HTML navigation 206; 292 tests OK, 7 skipped; repo audit 0 findings.
  • tests/test_release_workflow.py checks:
    • the trigger and permissions;
    • draft-only creation and no overwrite;
    • the master and required-check guards;
    • that only verifiable placeholders are filled;
    • env-only inputs;
    • the checkout pin.
  • Not run in Actions yet: the next tag (v0.2.0, Release v0.2.0: the first tag that contains the agent plugin #101) is the first real run. That includes whether GITHUB_TOKEN may read rules/branches/master; the dry run used a personal token.

Limitations

  • The previous tag is the highest v* tag reachable from the commit. A hotfix tag on an older line would compare against that line, not the newest release.

🤖 Generated with Claude Code

v0.1.0 was cut by hand: the tag commit, its CI run and the SHA in the notes
were all copied manually. release.yml now runs on a pushed v* tag, refuses a
commit that is not on master or whose required checks (read from the master
ruleset, the single list) did not all pass there, and opens a draft release
from templates/RELEASE_NOTES.template.md with the tag, full SHA, previous tag,
compare link and CI run filled in. It never publishes and never touches an
existing release. The maintenance workflow gains a "Cut a release" section.

A dry run of the three step scripts against v0.1.0 verified the checks and
produced the expected notes; creating the draft itself is first exercised by
the next tag.

Closes #56

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@drevendev
drevendev merged commit 611af69 into master Oct 23, 2026
5 checks passed
@drevendev
drevendev deleted the beautifulrepo/release-drafts-20261023 branch October 23, 2026 08:41
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.

Automate releases

1 participant