Skip to content

release: hold the run on the release-approval environment until the staged versions are approved - #6638

Merged
colinhacks merged 1 commit into
mainfrom
release-approval-env
Sep 30, 2026
Merged

colinhacks merged 1 commit into
mainfrom
release-approval-env

Conversation

@colinhacks

Copy link
Copy Markdown
Owner

The wait for the npm 2FA approval no longer runs on a hosted runner. A release had 350 minutes before the job hit GitHub's six-hour cap and had to be re-run. Now the run is held on a release-approval environment, with no runner, for up to 30 days.

One run, three release jobs, same shape as pullfrog/workshell#5:

  • stage builds and stages zod and @zod/mini. It stays on the npm environment, since the trusted publishers are bound to it. The step summary lists the stager approve / stager reject commands and the manual fallback.
  • approval is a job on release-approval. stager approve approves on npm and then approves this deployment. It is skipped when npm already serves both versions.
  • finish waits up to 340 minutes for npm to serve both versions, which also covers npm's post-approval review (116 minutes on 4.6.0). Then it tags, creates the GitHub release, publishes both packages to JSR and runs the lockstep check.

The environment approval only resumes the run. A run resumed without the npm approval fails in finish and releases nothing.

Smaller changes in the same pass:

  • A release concurrency group queues a second dispatch behind a held run.
  • stage drops contents: write.
  • The changelog ends at the run's commit instead of main, because main can move while the run is held.

release-approval has to exist before the first release. Without it, GitHub creates it unprotected on first use, approval passes at once, and finish does the waiting, as the old job did. To create it with @colinhacks as the required reviewer:

gh api -X PUT repos/colinhacks/zod/environments/release-approval --input - <<'JSON'
{"wait_timer": 0, "prevent_self_review": false, "reviewers": [{"type": "User", "id": 3084745}], "deployment_branch_policy": null}
JSON

…taged versions are approved

The wait for the npm 2FA approval ran on a hosted runner, so a release had 350 minutes before the job hit GitHub's six-hour cap and had to be re-run. The job now splits into three:

- stage (still on the npm environment, which the trusted publishers are bound to) builds, stages zod and @zod/mini, and writes the approval commands into the step summary.
- approval sits on the release-approval environment. GitHub holds it with no runner for up to 30 days, until the deployment is approved; `stager approve` approves on npm and then approves this deployment.
- finish waits up to 340 minutes for npm to serve both versions, which also absorbs npm's post-approval review, then tags, creates the GitHub release, publishes both packages to JSR and checks lockstep.

The environment approval is only the resume signal. A run resumed without the npm approval fails in finish instead of releasing. When both versions are already served, approval is skipped and finish runs directly.

Also: a workflow-level concurrency group queues a second dispatch behind a held run, the stage job drops contents: write, and the changelog ends at the run's commit rather than main, which may have moved while the run was held.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@colinhacks
colinhacks merged commit 004d800 into main Sep 30, 2026
7 checks passed
@colinhacks
colinhacks deleted the release-approval-env branch September 30, 2026 23:19
colinhacks added a commit that referenced this pull request Oct 12, 2026
…taged versions are approved (#6638)

The wait for the npm 2FA approval ran on a hosted runner, so a release had 350 minutes before the job hit GitHub's six-hour cap and had to be re-run. The job now splits into three:

- stage (still on the npm environment, which the trusted publishers are bound to) builds, stages zod and @zod/mini, and writes the approval commands into the step summary.
- approval sits on the release-approval environment. GitHub holds it with no runner for up to 30 days, until the deployment is approved; `stager approve` approves on npm and then approves this deployment.
- finish waits up to 340 minutes for npm to serve both versions, which also absorbs npm's post-approval review, then tags, creates the GitHub release, publishes both packages to JSR and checks lockstep.

The environment approval is only the resume signal. A run resumed without the npm approval fails in finish instead of releasing. When both versions are already served, approval is skipped and finish runs directly.

Also: a workflow-level concurrency group queues a second dispatch behind a held run, the stage job drops contents: write, and the changelog ends at the run's commit rather than main, which may have moved while the run was held.
sickn33 added a commit to sickn33/agentic-awesome-skills that referenced this pull request Nov 3, 2026
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)

<h3>Snyk has created this PR to upgrade zod from 4.6.6 to 4.6.7.</h3>

:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

<hr/>

- The recommended version is **1 version** ahead of your current version.

- The recommended version was released **21 days ago**.

#### Breaking Change Risk

![Merge Risk: Low](https://img.shields.io/badge/Merge%20Risk%3A%20Low-006400?style=for-the-badge)

> **Notice:** This assessment is enhanced by AI.

<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>zod</b></summary>
    <ul>
      <li>
        <b>4.6.7</b> - <a href="https://redirect.github.com/colinhacks/zod/releases/tag/v4.6.7">2026-10-12</a></br><h2>Commits:</h2>
<ul>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/b500a2ee95134f81d74da7911d7378dd2853d042/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/b500a2ee95134f81d74da7911d7378dd2853d042"><tt>b500a2e</tt></a> 4.6.7</li>
</ul>
      </li>
      <li>
        <b>4.6.6</b> - <a href="https://redirect.github.com/colinhacks/zod/releases/tag/v4.6.6">2026-10-11</a></br><blockquote>
<p>Six malicious commits pushed to <code>main</code> on September 21 with a compromised git credential were reverted the same day in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5532697020" data-permission-text="Title is private" data-url="colinhacks/zod#6620" data-hovercard-type="pull_request" data-hovercard-url="/colinhacks/zod/pull/6620/hovercard" href="https://redirect.github.com/colinhacks/zod/pull/6620">#6620</a> and have since been removed from the history of <code>main</code>. None were ever published to npm. The npm provenance for 4.6.6 names <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/284243fb0d6532665afdc9239188773bb624f73c/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/284243fb0d6532665afdc9239188773bb624f73c"><tt>284243f</tt></a>, the pre-rewrite copy of <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/9c219833c3a3764fa1f1ea9c5ecec8254a63c0b1/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/9c219833c3a3764fa1f1ea9c5ecec8254a63c0b1"><tt>9c21983</tt></a> with identical contents.</p>
</blockquote>
<h2>Commits:</h2>
<ul>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/0cd3af5e9f50ad11bbcd4407a46a21b8848ba574/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/0cd3af5e9f50ad11bbcd4407a46a21b8848ba574"><tt>0cd3af5</tt></a> docs: load the en locale directly in Zod Mini</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/9d5e60f162997b764b40d45aa02481888db50dea/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/9d5e60f162997b764b40d45aa02481888db50dea"><tt>9d5e60f</tt></a> docs: import locales from zod/locales, not z.locales</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/34a626f307871ecbb0123947559328dc52ed5e3e/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/34a626f307871ecbb0123947559328dc52ed5e3e"><tt>34a626f</tt></a> docs: tighten the z.locales tree-shaking note</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/74304ce5b5796b5edb9a88ceb8e170b6ea3e82df/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/74304ce5b5796b5edb9a88ceb8e170b6ea3e82df"><tt>74304ce</tt></a> release: stage npm versions instead of publishing them (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5535952118" data-permission-text="Title is private" data-url="colinhacks/zod#6622" data-hovercard-type="pull_request" data-hovercard-url="/colinhacks/zod/pull/6622/hovercard" href="https://redirect.github.com/colinhacks/zod/pull/6622">#6622</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/b2ef983e0711ff6517d6020b021071e2e5653efa/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/b2ef983e0711ff6517d6020b021071e2e5653efa"><tt>b2ef983</tt></a> docs: add Code for Japan to bronze sponsors</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/8fb2faf0584828a6a027d8279db36f6f52784462/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/8fb2faf0584828a6a027d8279db36f6f52784462"><tt>8fb2faf</tt></a> docs: crop the Code for Japan logo and list it first in bronze</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/bacad518c41610d654658172d325874bf0ee6290/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/bacad518c41610d654658172d325874bf0ee6290"><tt>bacad51</tt></a> docs: square the Code for Japan logo to match the other bronze tiles</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/c42596bd1c87e941d7241d10e012c5c196adcc10/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/c42596bd1c87e941d7241d10e012c5c196adcc10"><tt>c42596b</tt></a> release: hold the run on the release-approval environment until the staged versions are approved (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5650176933" data-permission-text="Title is private" data-url="colinhacks/zod#6638" data-hovercard-type="pull_request" data-hovercard-url="/colinhacks/zod/pull/6638/hovercard" href="https://redirect.github.com/colinhacks/zod/pull/6638">#6638</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/a2ba4a67986a3e6b2b131be30084a2f460d9ea67/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/a2ba4a67986a3e6b2b131be30084a2f460d9ea67"><tt>a2ba4a6</tt></a> fix(types): declare record output and input as members, not base type arguments (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5681347415" data-permission-text="Title is private" data-url="colinhacks/zod#6645" data-hovercard-type="pull_request" data-hovercard-url="/colinhacks/zod/pull/6645/hovercard" href="https://redirect.github.com/colinhacks/zod/pull/6645">#6645</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/a0ebf970f2d752e5f58527cd2942ff48be4f46bd/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/a0ebf970f2d752e5f58527cd2942ff48be4f46bd"><tt>a0ebf97</tt></a> fix(v4): check array, set and map size bounds before parsing elements (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5748245663" data-permission-text="Title is private" data-url="colinhacks/zod#6652" data-hovercard-type="pull_request" data-hovercard-url="/colinhacks/zod/pull/6652/hovercard" href="https://redirect.github.com/colinhacks/zod/pull/6652">#6652</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/529f78dd9431b07f49647fee3aa0819b3f8b66b7/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/529f78dd9431b07f49647fee3aa0819b3f8b66b7"><tt>529f78d</tt></a> 4.6.6</li>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/colinhacks/zod/commit/9c219833c3a3764fa1f1ea9c5ecec8254a63c0b1/hovercard" href="https://redirect.github.com/colinhacks/zod/commit/9c219833c3a3764fa1f1ea9c5ecec8254a63c0b1"><tt>9c21983</tt></a> ci: stage at verbose so a failed OIDC token exchange says why</li>
</ul>
      </li>
    </ul>
    from <a href="https://redirect.github.com/colinhacks/zod/releases">zod GitHub release notes</a>
  </details>
</details>

---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with your project.
> - This PR was automatically created by Snyk using the credentials of a real user.

---

**Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs._

**For more information:** <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6ImZha2Uta2V5IiwiYW5vbnltb3VzSWQiOiI2NmUwMjczOC0yYTBhLTRiMzMtOWE0ZS02NmU5YWUyMTYzZmEiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjY2ZTAyNzM4LTJhMGEtNGIzMy05YTRlLTY2ZTlhZTIxNjNmYSJ9fQ==" width="0" height="0"/>

> - 🧐 [View latest project report](https://app.eu.snyk.io/org/antigravity-awesome-skills-default/project/e1a72459-d983-4446-8d5e-73739c13b5ba?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR settings](https://app.eu.snyk.io/org/antigravity-awesome-skills-default/project/e1a72459-d983-4446-8d5e-73739c13b5ba/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.eu.snyk.io/org/antigravity-awesome-skills-default/project/e1a72459-d983-4446-8d5e-73739c13b5ba/settings/integration?pkg&#x3D;zod&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

[//]: # 'snyk:metadata:{"breakingChangeRiskLevel":"low","FF_showPullRequestBreakingChanges":true,"FF_showPullRequestBreakingChangesWebSearch":false,"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"zod","from":"4.6.6","to":"4.6.7"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"66e02738-2a0a-4b33-9a4e-66e9ae2163fa","prPublicId":"66e02738-2a0a-4b33-9a4e-66e9ae2163fa","packageManager":"npm","priorityScoreList":[],"projectPublicId":"e1a72459-d983-4446-8d5e-73739c13b5ba","projectUrl":"https://app.eu.snyk.io/org/antigravity-awesome-skills-default/project/e1a72459-d983-4446-8d5e-73739c13b5ba?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2026-10-12T16:29:37.778Z"},"vulns":[]}'

This branch was successfully deployed

1 active deployment
Preview – zod-v4 — c3c8d7ad Deployed Sep 30, 2026 by vercel[bot]
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.

2 participants