Repository navigation
Release automatically on successful main CI with patch bumps - #38
Conversation
Evals: passedSuite: copilot-smoke Lint: validated (no model execution) - Evidence Run: passed - 1 trial - Evidence
Quality & token summary
|
There was a problem hiding this comment.
🟡 Changes recommended
Stale publish retries can roll back the major alias and Latest release designation, while unpublished drafts can incorrectly trigger alias advancement.
2 open issues
What changed in this PR
Adds a manual, dry-run-first release process for the Action, separating exact-commit verification from environment-gated publication.
Changes:
- Add main-only dispatch, exact-SHA CI checks, and version-tag, GitHub Release, and major-alias publication.
- Add release planning for version ordering, Latest eligibility, and stable-release license checks.
- Integrate release tests into check scripts and update release and version-pinning documentation.
| File | Description |
|---|---|
tooling/release.test.mjs |
Tests version validation, ordering, aliases, and license gates. |
tooling/release.mjs |
Implements release planning and workflow outputs. |
tests/example.test.ts |
Checks workflow structure, permissions, and publication commands. |
README.md |
Makes tag and commit-pinning guidance evergreen. |
package.json |
Includes release tests in package and development checks. |
CONTRIBUTING.md |
Documents release verification, publication, and recovery. |
.github/workflows/release.yml |
Adds read-only verification and environment-gated publication jobs. |
Review effort: Max (adaptive)
There was a problem hiding this comment.
🔵 Needs a closer look
The privileged release workflow coordinates tags, releases, and consumer-facing aliases across retries, with unexercised publication writes and reliance on repository environment protections requiring broader review.
No open issues 🎉
1 resolved since last review
Review effort: Max (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Recheck the verified plan against current remote tags before any write, and resume an existing release only when it is published with the requested prerelease setting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1880bc5 to
3304ec2
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The privileged release workflow combines environment approvals, exact-SHA verification, partial-publication retries, and forced consumer-alias updates, creating interacting publication risks that warrant human operational review.
No open issues 🎉
Review effort: Max (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ued runs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Review-body findings, all heads:
|
`git diff --name-only` follows renames and lists only the destination, so moving a file out of src/ skipped the automatic release. Disable rename detection and cover the plan CLI against a real repository. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Re: Copilot review 5981500534 (
Re: Copilot review 5982395188 (
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the tests leave automatic parsing of older breaking changes uncovered, creating a risk of incorrectly planning a patch release.
No open issues 🎉
1 resolved since last review
Review effort: Max (adaptive)
|
Review 5982779246 (### 🔵 Needs a closer look),
|
wbreza
left a comment
There was a problem hiding this comment.
Pull Request Review Summary
Overall, the release workflow and planner design are clean, well-structured, and careful about tag immutability, license-gap blocking on stable releases, and retry staleness checks. However, there are two issues (1 High, 1 Medium) that should be addressed before relying on unattended publication, plus two minor (Low) hardening suggestions:
| Severity | Location | Summary |
|---|---|---|
| High | .github/workflows/release.yml:136-142 |
.deployment_branch_policy != null accepts "Protected branches only" (protected_branches: true) — which currently marks every branch in github/evals-action as protected via the org-wide ~ALL ruleset — as well as non-main/tag custom policies. |
| Medium | tooling/release.mjs:81-86 (and :50) |
automaticInput / planAutomatic treats diverged release tags and git merge-base errors as "already covered" (release=false, exit 0), which would silently wedge unattended releases if a version tag ever diverges from main. |
| Low | tooling/release.mjs:80 |
automaticInput passes messages: [] when no version tag exists yet, bypassing the breaking-change commit guard on initial tagless runs. |
| Low | .github/workflows/release.yml:63 |
Use fully qualified ref: refs/heads/main in verify checkout so a tag named main cannot shadow the branch ref. |
See inline comments for details and suggested fixes.
|
|
||
| function automaticInput(tags) { | ||
| const latest = newestVersion(tags); | ||
| if (!latest) return { tags, latestIsAncestor: true, changedFiles: git('ls-files').split('\n').filter(Boolean), messages: [] }; |
There was a problem hiding this comment.
[Low] Read commit messages when no version tag exists yet
When !latest, passing messages: [] skips the BREAKING_SUBJECT / BREAKING_FOOTER check in planAutomatic, even though line 49 (newestVersion(tags) ?? 'the first commit') prepares the breaking-change error message for this exact case. Using git('log', '--format=%B%x00', 'HEAD').split('\0').map((message) => message.trim()).filter(Boolean) keeps the breaking-change guard consistent on tagless repositories/forks as well.
There was a problem hiding this comment.
Declined (Low): this repo already has version tags, so the tagless path only affects a fresh fork's first release; kept out of this fix.
| exit 1 | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| ref: main |
There was a problem hiding this comment.
[Low] Prefer fully qualified ref: refs/heads/main
Using ref: refs/heads/main instead of ref: main avoids ref disambiguation if a tag named main were ever created (for example, pointing to an older main commit that already has a passing Model-free CI push run).
There was a problem hiding this comment.
Declined (Low): hardening only; no main tag exists, and kept out of this fix's scope.


Summary
Adds an automatic, repeatable release workflow for the Action.
.github/workflows/release.yml:Model-free CIpush run onmain, plus a six-hourly reconciliation schedule, only while the repository variableAUTO_RELEASEistrue. Each run targets the currentmainhead, so a replaced or missed run self-heals. It cuts the next patch only whensrc/,dist/oraction.ymlchanged since the newest version tag; docs/test/workflow-only pushes skip. Breaking-change commits (type!:orBREAKING CHANGE:) fail instead of shipping as a patch.AUTO_RELEASE_PRERELEASE(defaulttrue) selects prerelease.workflow_dispatchfrommainwithbump(patch/minor/major, defaultminor),prerelease(defaulttrue) anddry_run(defaulttrue).Model-free CIpush run on the exact head SHA (automatic runs skip until it succeeds), rerunspnpm checkand requires a clean checkout.releaseenvironment,contents: write): requires a branch-restricted environment (no reviewer gate, so releases complete unattended), creates an annotated version tag, publishes the GitHub Release, advances the matching major alias (v0/v1) and verifies every written tag resolves to the verified SHA. Rerun-safe; fails closed if an existing tag points elsewhere.tooling/release.mjs+node --testtests: version bumping from the newest tag, shipped-file gating, ancestry skip, breaking-change refusal, existing-tag refusal, alias/latest rules, and stable releases refused whilemissing-license-textentries remain.Verification
corepack pnpm checkpassed (typecheck, oxlint, vitest incl. the release workflow contract test,check:dist, 6 packaged tests, 10 release tests).contents: read; write only in the environment-gated publish job;workflow_runexecutes trusted default-branch code; inputs flow throughenv. Tag pushes made withGITHUB_TOKENdo not retrigger workflows.distmatch source.distunchanged;check:distpasses.Limitations
AUTO_RELEASEunset, run adry_run: truedispatch, dispatchminorto cutv0.3.0, then setAUTO_RELEASE=true. Unsetting it is the off switch.releaseenvironment's deployment branches tomain(publish fails closed until then).binary@0.3.0,buffers@0.1.1,chainsaw@0.1.0(stable releases stay blocked until resolved).