Skip to content

MOPS-113: hold workflow changes while a release runs - #8

Merged
kiliantyler merged 1 commit into
mainfrom
feat/release-freeze
Nov 18, 2026
Merged

kiliantyler merged 1 commit into
mainfrom
feat/release-freeze

Conversation

@kiliantyler

Copy link
Copy Markdown
Contributor

Why

Releases use only the workflow's own token (owner decision). GitHub refuses that token when it tags a commit whose workflow files differ from the default branch's. A workflow change that merges while a release runs therefore leaves the release published and untagged. On Talaria this happened on the first real release under the contract: a three-hour run, 40 merges, two workflow files changed. The owner chose to block such merges.

What

A new shared action, release-freeze, and contract rule 6. It keeps a commit status named release-freeze on pull requests:

  • mode: start, a release's first job: fails the status on every open pull request that changes a file under .github/workflows/.
  • mode: end, a last job with if: always(): passes it again, however the release ended. It leaves the freeze in place while another release is still running.
  • mode: pull-request, in CI on every pull request: sets that pull request's own status, so one opened or pushed during a release is caught, and every pull request carries the status so it can be a required check.

A check that only ran at push time would not do: a release can start after it passed. Hence the status the release flips.

Needs statuses: write, pull-requests: read, actions: read from the workflow's own token. No new credential. Agents merge on green checks, so a failing status stops them; making GitHub refuse the merge for a person needs release-freeze listed as a required check, which is a repository setting.

Out of scope: direct pushes to the default branch, and pull requests from forks (their token cannot post a status).

Tests

node --test: one new test covers a release freezing only the pull requests that change a workflow file, thawing them at the end, keeping the freeze while a second release runs, a pull request's own push during and outside a release, one that changes no workflow file, and a renamed workflow file.

A release's own token cannot tag a commit whose workflow files differ from the default branch's, so a workflow
change that merges mid-release leaves it published and untagged. release-freeze keeps a commit status of that
name on pull requests: a release fails it on the open ones that change a workflow file when it starts and
passes it when it ends, and CI sets it on every pull request push. No credential beyond the workflow's token.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T09:05:00.444717Z f229130 PR opened
🔒 Security Review ✅ Completed 2026-11-18T09:11:25.711987Z f229130 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kiliantyler
kiliantyler merged commit e3a3f4a into main Nov 18, 2026
1 check passed
@kiliantyler
kiliantyler deleted the feat/release-freeze branch November 18, 2026 09:03

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f229130194

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread RELEASES.md
Comment on lines +84 to +85
freeze:
needs: preflight

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make publishing depend on a successful freeze

In the release workflow template, freeze depends on preflight, but neither verify, publish, nor release depends on freeze. Consequently, publishing can begin while the freeze is still being applied, and a failed freeze does not stop publishing or tagging at all. If status posting fails or a workflow-changing PR merges before its status is updated, the release can still end up published but untagged—the failure this change is intended to prevent. Make successful freezing a prerequisite of the publishing path.

Useful? React with 👍 / 👎.

Comment thread RELEASES.md
Comment on lines +134 to +136
thaw:
needs: [freeze, release]
if: always()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Re-establish the freeze when retrying failed release jobs

If publish fails, this unconditional thaw succeeds and clears the freeze. Following the documented recovery instruction to re-run failed jobs then retries publishing without rerunning the already-successful freeze job. GitHub documents that these retries include dependent jobs, not successful prerequisite jobs. Existing workflow-changing PRs therefore remain green throughout the retry and can merge before tagging. Ensure the freeze is reapplied on publishing retries, or change the supported recovery procedure so it necessarily reruns the freeze.

Useful? React with 👍 / 👎.

Comment thread lib/release.js
Comment on lines +231 to +233
if (mode === "pull-request") {
await set(pull, (await changesWorkflows(api, pull.number)) && (await releaseRunning(api, { workflow, branch })));
return { frozen, thawed };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent PR checks from restoring the freeze after thawing

If a PR's freeze check runs after mode: end has posted success but before the release workflow finishes, this query still sees that release as in_progress and posts failure again. The release's thaw has already processed the PR, so nothing clears the new failure after the run completes; a required release-freeze status leaves the PR blocked until another check or release updates it. This also affects PRs opened during the final thaw job. Coordinate PR checks with an explicit thawed state or perform reconciliation after workflow completion rather than treating every in-progress run as still frozen.

Useful? React with 👍 / 👎.

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