Skip to content

ci(workflows): scope release credentials and verify pr mirrors - #724

Draft
ko3n1g wants to merge 1 commit into
mainfrom
ko3n1g/ci/scoped-workflow-credentials
Draft

ko3n1g wants to merge 1 commit into
mainfrom
ko3n1g/ci/scoped-workflow-credentials

Conversation

@ko3n1g

@ko3n1g ko3n1g commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Background

Run uses shared workflows to prepare releases, publish wheels and documentation, and cut release branches. This brings those callers onto the protected release interface used by Gym and adds Gym’s mirror check for Guardwords.

What changed

  • Production release and code freeze select the run-release environment. Push validation and rehearsals use a read-only GitHub token. Manual releases check that the requested SHA belongs to the protected target branch. Production targets are main or version branches such as r0.13.0.
  • PyPI publication keeps its existing pypi environment and OIDC identity. Pushes and dry runs build the documentation artifact. The release publisher receives its AWS and Akamai inputs only when production docs publication is requested. The nightly docs workflow keeps its existing target and version-picker settings.
  • Guardwords checks the current PR head against the numeric mirror SHA before scanning the diff. The scanner receives the dedicated read-only catalog deploy key. The pre-commit hook and CI use the same template revision.
  • Every workflow declares its GitHub token permissions. Tag and changelog writes require a dispatch or schedule from main. The Community Bot retains its cross-organization App for membership and project access.
  • .github/CODEOWNERS covers .github/ and the pre-commit configuration. All shared workflow calls, the docs helper checkout, the Guardwords hook and the Renovate Python preset use the same template commit.

Details

flowchart LR
  M[PR mirror] --> A[Verify current PR head] --> G[Guardwords]
  R[Release dispatch from main] --> V[Verify SHA and protected target]
  V --> B[Prepare version] --> W[Build wheel]
  W --> P[Publish via PyPI OIDC] --> F[Finalize release]
  F --> D[Publish requested docs]
  C[Push or dry run] --> T[Build and validate wheel and docs]
  S[Freeze dispatch from main] --> H[Create release branch at verified cutoff]
Loading

GitHub now requires code-owner review in the classic protection rules for main and [rv][0-9]*.[0-9]*.[0-9]*. The release rule restricts pushes and branch creation. These settings were verified on main and r0.12.0. This PR adds ownership for CI configuration. The run-release environment allows only main and disables admin bypass. Production activation still requires its release App private key and permission for the App to create a protected release branch.

Tested

  • .venv/bin/python -m unittest discover -s .github/tests -p 'test_*workflow.py' -v passed all 13 tests, including stale mirror rejection, protected target ancestry, dry-run credential routing and PyPI OIDC permissions.
  • actionlint -oneline .github/workflows/*.yml and .venv/bin/pre-commit validate-config passed. Checked 11 upstream and four local reusable workflow calls against their input, secret and output declarations, and 19 documentation action inputs against its manifest.
  • .venv/bin/ruff check . .github/tests and .venv/bin/ruff format --check . .github/tests passed across 172 Python files. detect-secrets-hook --baseline .github/workflows/config/.secrets.baseline passed for the staged files. The two new baseline entries identify the public template commit hash.

Signed-off-by: oliver könig <okoenig@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
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