Skip to content

Release automatically on successful main CI with patch bumps - #38

Merged
jongio merged 8 commits into
mainfrom
jongio/release-workflow
Nov 19, 2026
Merged

jongio merged 8 commits into
mainfrom
jongio/release-workflow

Conversation

@jongio

@jongio jongio commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds an automatic, repeatable release workflow for the Action.

  • .github/workflows/release.yml:
    • Automatic patch releases: after each successful Model-free CI push run on main, plus a six-hourly reconciliation schedule, only while the repository variable AUTO_RELEASE is true. Each run targets the current main head, so a replaced or missed run self-heals. It cuts the next patch only when src/, dist/ or action.yml changed since the newest version tag; docs/test/workflow-only pushes skip. Breaking-change commits (type!: or BREAKING CHANGE:) fail instead of shipping as a patch. AUTO_RELEASE_PRERELEASE (default true) selects prerelease.
    • Manual releases: workflow_dispatch from main with bump (patch/minor/major, default minor), prerelease (default true) and dry_run (default true).
    • verify (read-only): plans the release, requires a successful Model-free CI push run on the exact head SHA (automatic runs skip until it succeeds), reruns pnpm check and requires a clean checkout.
    • publish (release environment, 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 --test tests: version bumping from the newest tag, shipped-file gating, ancestry skip, breaking-change refusal, existing-tag refusal, alias/latest rules, and stable releases refused while missing-license-text entries remain.
  • CONTRIBUTING documents both modes, the variables and retries.

Verification

  • Model-free checks and source-to-bundle verification pass. corepack pnpm check passed (typecheck, oxlint, vitest incl. the release workflow contract test, check:dist, 6 packaged tests, 10 release tests).
  • Native integration evidence is distinguished from synthetic controls. No native behavior changed; the release workflow has not run on GitHub yet (see Limitations).
  • Credential, process and artifact boundaries were reviewed. Default contents: read; write only in the environment-gated publish job; workflow_run executes trusted default-branch code; inputs flow through env. Tag pushes made with GITHUB_TOKEN do not retrigger workflows.
  • Documentation and packaged dist match source. dist unchanged; check:dist passes.

Limitations

  • Rollout: merge with AUTO_RELEASE unset, run a dry_run: true dispatch, dispatch minor to cut v0.3.0, then set AUTO_RELEASE=true. Unsetting it is the off switch.
  • Admin setting: restrict the release environment's deployment branches to main (publish fails closed until then).
  • Consumer pin updates are not triggered from this repository; downstream repositories reconcile on their own schedule, keeping cross-repository credentials out of this public repo.
  • Out of scope: supplementing license text for binary@0.3.0, buffers@0.1.1, chainsaw@0.1.0 (stable releases stay blocked until resolved).

@jongio
jongio requested a review from a team as a code owner November 19, 2026 06:06
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 06:06
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Evals: passed

Suite: copilot-smoke

Lint: validated (no model execution) - Evidence

Run: passed - 1 trial - Evidence

Eval Trials Result
copilot-skill-smoke 1 passed

Quality & token summary

Eval Model Verdict Score Turns Duration Tokens
copilot-skill-smoke - passed 1.00 (threshold 1.00) 2 2479ms 33349 tokens (33276 in / 73 out)

Exact revision | Workflow run

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test hard-codes a specific setup-node commit SHA, causing routine Dependabot pin updates to fail the unit check even when the new SHA is valid.

1 open issue
2 resolved since last review

Review effort: Max (adaptive)

Comment thread tests/example.test.ts Resolved
Comment thread .github/workflows/release.yml Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate a stale release-retry edge case involving existing version tags and the adequacy of the documented recovery guidance.

No open issues 🎉

Review effort: Max (adaptive)

jongio and others added 4 commits November 19, 2026 04:33
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>
@jongio
jongio force-pushed the jongio/release-workflow branch from 1880bc5 to 3304ec2 Compare November 19, 2026 12:33
@jongio
jongio requested an adaptive review from Copilot November 19, 2026 12:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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>
@jongio jongio changed the title Add manual release workflow with exact-SHA gates and moving major alias Release automatically on successful main CI with patch bumps Nov 19, 2026
@jongio
jongio requested an adaptive review from Copilot and removed request for Copilot November 19, 2026 18:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Case-sensitive Conventional Commit parsing can misclassify breaking changes as patch releases, bypassing the automatic-release safeguard.

3 open issues

Review effort: Max (adaptive)

Comment thread tooling/release.mjs Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread CONTRIBUTING.md Resolved
…ued runs

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio

jongio commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Review-body findings, all heads:

  • 5970298959 (stale retries roll back alias/Latest; drafts advance alias): fixed in earlier heads; review 5970439369 lists both as resolved.
  • 5970439369 (hard-coded setup-node SHA in test): fixed; review 5970572070 lists it as resolved.
  • 5970572070, 5970745606, 5975269788 (🔵 needs a closer look: concern:7fa2e852d4fa51a0, concern:0e782a87d1e64f77, concern:d2b75e3eab52d3be): advisory, no specific defect. On head 80a1d48, publication still requires the release environment, exact-SHA CI verification and a tag-resolves-to-commit check, and existing tags are never overwritten. The required code-owner review covers the operational human review.
  • 5980929356 (concern:57fad14c2e0483c2): case-insensitive breaking subjects and queue: max fixed in 80a1d48. The prerelease license-policy note is declined by release-owner decision; dependency cleanup is tracked separately.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Release-planning edge cases involving file moves and gaps in CLI-level test coverage require human assessment of release correctness.

No open issues 🎉

3 resolved since last review

Review effort: Max (adaptive)

`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>
@jongio

jongio commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Re: Copilot review 5981500534 (concern:328a0d2326dbaeb2, file moves and CLI test coverage)

  • Fixed in 2e2edda: git diff --name-only followed renames, so moving a file out of src/ skipped the automatic release. Rename detection is now off.
  • Added a CLI-level test that runs release.mjs plan against a real temporary repository containing that move.

Re: Copilot review 5982395188 (concern:b1ac24c561edee7f, concern:5ca0b8922b3dffa4, signing in the temporary repository)

  • Fixed in 63d4fc4: the temporary repository disables commit and tag signing.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release test’s temporary repository inherits global commit and tag signing settings, which can make pnpm check fail or wait for a signing agent on contributors’ machines.

1 open issue

Review effort: Max (adaptive)

Comment thread tooling/release.test.mjs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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)

@jongio

jongio commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Review 5982779246 (### 🔵 Needs a closer look), concern:0253496a9dbcfa1f: no defect; no change.

  • automaticInput reads every commit since the newest tag with git log --format=%B%x00 <latest>..HEAD and splits on NUL, so every commit message is checked, not just the newest one.
  • Checked against a real repo (tag, then feat!:, then a BREAKING CHANGE: footer, then a newest docs: commit). Result: [["docs: newest",false,false],["fix: older footer",false,true],["feat!: drop input",true,false]]. Both older breaking commits are flagged, so planAutomatic refuses the patch release (the rule is covered by tooling/release.test.mjs:78-83).

@wbreza wbreza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/release.yml Resolved
Comment thread tooling/release.mjs Resolved
Comment thread tooling/release.mjs

function automaticInput(tags) {
const latest = newestVersion(tags);
if (!latest) return { tags, latestIsAncestor: true, changedFiles: git('ls-files').split('\n').filter(Boolean), messages: [] };

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declined (Low): hardening only; no main tag exists, and kept out of this fix's scope.

@jongio
jongio merged commit 5cb269e into main Nov 19, 2026
11 checks passed
@jongio
jongio deleted the jongio/release-workflow branch November 19, 2026 22:23
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.

4 participants