Skip to content

Pin PyPI release actions to immutable commits - #10

Open
parkjinman98 wants to merge 1 commit into
mainfrom
codex/fix-mutable-actions-in-pypi-release-workflow
Open

Pin PyPI release actions to immutable commits#10
parkjinman98 wants to merge 1 commit into
mainfrom
codex/fix-mutable-actions-in-pypi-release-workflow

Conversation

@parkjinman98

Copy link
Copy Markdown
Contributor

Motivation

  • The release workflow used mutable action refs (tags/branches) while granting id-token: write, creating a supply-chain risk that a compromised upstream action could publish arbitrary packages to PyPI.
  • Pinning actions to reviewed full commit SHAs ensures the code executed in OIDC-enabled publish jobs is auditable and cannot be silently altered by retargeting tags.

Description

  • Replaced every mutable uses: reference in .github/workflows/publish.yml with a 40-hex commit SHA pointing at the reviewed action commit while preserving a human-readable version comment for future updates.
  • Action pins include actions/checkout, actions/setup-python, actions/upload-artifact, actions/download-artifact, and pypa/gh-action-pypi-publish in both TestPyPI and PyPI jobs.
  • The change only modifies the single workflow file to enforce immutable action resolution and does not alter any build, upload, or publish logic.

Testing

  • Ran a custom audit script that validated all seven uses: references in .github/workflows/publish.yml are full 40-character commit SHAs and it succeeded.
  • Ran git diff --check and confirmed no whitespace/check errors, and git status --short to confirm the working tree is clean after committing the change.
  • Attempted pre-commit run --files .github/workflows/publish.yml, but pre-commit was not installed in the environment (noted as informational, not a failure).

Codex Task

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T04:10:46.500558Z 2dc8bc0 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.

@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: 2dc8bc089c

ℹ️ 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".


- name: Upload built distributions
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

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 Pin the current action majors instead of downgrading them

This SHA is upload-artifact v4.6.2 rather than an immutable pin for the previously selected v7; the same change downgrades download-artifact from v7 to v4.3.0, checkout from v5 to v4.2.2, and setup-python from v6 to v5.6.0. Consequently, the next release silently runs older action generations and loses the compatibility and security fixes for which the workflow had selected the newer majors, rather than merely making its existing dependencies immutable. Resolve each original major tag to its reviewed commit SHA and pin that commit.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant