Skip to content

Add a "release-gate" step to the release workflow#18804

Merged
zanieb merged 1 commit intomainfrom
zb/release-gate
Apr 1, 2026
Merged

Add a "release-gate" step to the release workflow#18804
zanieb merged 1 commit intomainfrom
zb/release-gate

Conversation

@zanieb
Copy link
Copy Markdown
Member

@zanieb zanieb commented Apr 1, 2026

The way this works is

  1. release-gate is an environment which requires approval from another person in the organization
  2. Once approved, the release can continue
  3. GitHub then requires approval for every subsequent job, which we use the release environment for
  4. We do not require team members to approve on the release environment because we run many child jobs during releases
  5. The release environment uses a deployment protection rule which queries a GitHub App we manage
  6. The GitHub App checks if the release-gate job was successful in the same workflow and approves or denies accordingly

The GitHub App's source is at https://github.com/open-security-tools/ost-environment-gate and includes another explanation of what's going on in this process.

We don't make the release-gate block everything, so builds can start at least while we wait for the release-gate to be approved.

@zanieb zanieb force-pushed the zb/release-gate branch from c9039c2 to 1f795b5 Compare April 1, 2026 19:15
@zanieb zanieb marked this pull request as ready for review April 1, 2026 19:35
@zanieb zanieb force-pushed the zb/release-gate branch from 1f795b5 to 8f1d8cc Compare April 1, 2026 19:38
@zanieb zanieb force-pushed the zb/release-gate branch from 8f1d8cc to d694098 Compare April 1, 2026 19:43
Comment on lines -111 to +122
if: ${{ needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload' || inputs.tag == 'dry-run' }}
- release-gate
if: ${{ always() && needs.plan.result == 'success' && (needs.release-gate.result == 'success' || needs.release-gate.result == 'skipped') && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload' || inputs.tag == 'dry-run') }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This fixes dry-run Docker builds, which probably weren't working before. Oops!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not critical for this PR, but we could probably simplify these conditions a bit with the new case() function:

https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#case

@zanieb zanieb added internal A refactor or improvement that is not user-facing build:skip-release Disable building release binaries for a pull request labels Apr 1, 2026
@zanieb zanieb merged commit 6b1ebc3 into main Apr 1, 2026
71 checks passed
@zanieb zanieb deleted the zb/release-gate branch April 1, 2026 20:23
Comment on lines +59 to +61
environment:
name: release-gate
deployment: false
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.

Can we add a comment or something to this? This is Absolute Sorcery and without the context of this PR looks like a noop task.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

zanieb added a commit to astral-sh/ruff that referenced this pull request Apr 2, 2026
Mirrors astral-sh/uv#18804

You can see the environment policies I'll apply following merge at
https://github.com/astral-sh/github-policies/tree/main/environments

Also updates the Docker workflow to avoid using release secrets when not
pushing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:skip-release Disable building release binaries for a pull request internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants