Skip to content

ci: pin actions, add least-privilege permissions, and gate release on tests - #713

Merged
ffumero2003 merged 1 commit into
masterfrom
ci-python-low-audit-permissions-security-release-gate
Nov 21, 2026
Merged

ffumero2003 merged 1 commit into
masterfrom
ci-python-low-audit-permissions-security-release-gate

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

Context

CI workflows use mutable action references and the tag-triggered release workflow can publish without running tests on the tagged commit.

Changes

  • Pin active workflow actions to their current upstream commit SHAs and limit the CI token to read-only repository contents.
  • Run the SDK unit-test session on the tagged commit and require it to pass before deployment.
  • Add checks for action pins, CI permissions, and the release dependency.

The security disclosure policy is deferred to #635. Action pinning and release workflow changes overlap #648 and #672 and should be reconciled before merging.

Verification

  • actionlint .github/workflows/*.yml
  • python -m pytest test/static -q (64 passed, 2 expected failures)
  • Python 3.14 nox -vs unit -p 3.14 -- -v (v0–v3 passed; local run limited to four workers)
  • Ruff and towncrier checks passed.

Refs #711

@ffumero2003 ffumero2003 self-assigned this Nov 21, 2026
@ffumero2003
ffumero2003 requested a review from goanpeca November 21, 2026 22:21
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CI workflow grants contents: read permission and pins external actions to commit SHAs. The CD workflow adds a unit-test job and makes deployment depend on its success. The deployment actions are also pinned to commit SHAs. New static tests check workflow permissions, action references, and release gating. A changelog entry records these changes.

Merge Risk: Minimal · up to 68247

This change pins workflow actions, makes CI read-only, and requires unit tests to pass before release. No concrete merge-blocking defect was found. Reconcile the overlap with #648 and #672 before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the three main changes: pinning actions, least-privilege permissions, and gating release on tests. The raw summary confirms each one: SHA pins across workflows, contents: read for CI, …
Description check Passed The description states the context and the changes: SHA pinning, read-only CI token, running unit tests before deployment, and new static checks. It also gives verification steps and related issues. T…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the three main changes: pinning actions, least-privilege permissions, and gating release on tests. The raw summary confirms each one: SHA pins across workflows, contents: read for CI, and a test job that deploy depends on. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description states the context and the changes: SHA pinning, read-only CI token, running unit tests before deployment, and new static checks. It also gives verification steps and related issues. These match the changeset in cd.yml, ci.yml, the changelog entry, and the new test file.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0ec84a0c-cf66-4af7-b377-3df828147f2f
Commits

Reviewing files that changed from the base of the PR and between 0da9bc0 and 6824756.

Files selected for processing: 4

  • .github/workflows/cd.yml
  • .github/workflows/ci.yml
  • changelog.d/+release-ci-safety.infrastructure.md
  • test/static/test_release_workflow_safety.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@ffumero2003
ffumero2003 merged commit dd366eb into master Nov 21, 2026
29 checks passed
@ffumero2003
ffumero2003 deleted the ci-python-low-audit-permissions-security-release-gate branch November 21, 2026 22:29
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