Skip to content

ci(py): pin Python workflow actions and drop default write access - #623

Closed
huangjeff5 wants to merge 1 commit into
feat/dotpromptz-python-handlebarsfrom
ci/python-workflow-hardening
Closed

huangjeff5 wants to merge 1 commit into
feat/dotpromptz-python-handlebarsfrom
ci/python-workflow-hardening

Conversation

@huangjeff5

Copy link
Copy Markdown
Collaborator

Stacked on #621 (which sits on #620). Moves the Python workflow hardening out of #620 so that PR only carries the Handlebars package.

Only .github/workflows/python.yml changes:

  • Every uses: is pinned to a commit SHA, with the tag in a trailing comment.
  • The workflow token defaults to contents: read. uv-lock-check keeps its job-level contents: write and pull-requests: write.
  • persist-credentials: false on the check-paths and python-checks checkouts.
  • tj-actions/changed-files moves from v45 to v47.0.6.

Decisions

  • Pin to SHAs, not tags: Tags are mutable. The March 2025 tj-actions/changed-files compromise retargeted existing tags to a commit that dumped CI secrets into logs. A SHA pin runs exactly the code that was reviewed.
  • Read-only by default, write where a job pushes: Previously, every job got the repo's default token scope. Only uv-lock-check writes, so it is the only job that asks for write.
  • uv-lock-check keeps its checkout credentials: That job runs git push to commit regenerated lockfiles back to release-please--* branches. persist-credentials: false there removes the token from the checkout and that push fails. The version of this change that was in feat(py)!: replace Rust handlebarrz with pure-Python dotpromptz-handlebars #620 had that bug.

@huangjeff5
huangjeff5 added this pull request to stack #624 October 1, 2026 21:33
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 41c8e97 to 189dbd4 Compare October 2, 2026 02:12
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 3e52b24 to a599e60 Compare October 2, 2026 02:35
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 189dbd4 to acbc3cb Compare October 2, 2026 02:35
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from a599e60 to 0bc8bd6 Compare October 2, 2026 02:37
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from acbc3cb to 0a83682 Compare October 2, 2026 02:37
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 0bc8bd6 to 8c7bf33 Compare October 2, 2026 02:45
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 0a83682 to 451584a Compare October 2, 2026 02:45
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 8c7bf33 to 49be9bd Compare October 2, 2026 02:49
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 451584a to 1fbd787 Compare October 2, 2026 02:49
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 49be9bd to 2a2fea2 Compare October 2, 2026 02:52
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 1fbd787 to 3b72740 Compare October 2, 2026 02:53
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 2a2fea2 to 1849ecd Compare October 2, 2026 03:03
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 3b72740 to 519db81 Compare October 2, 2026 03:04
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 1849ecd to d697e55 Compare October 2, 2026 03:08
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 519db81 to 6c0f2af Compare October 2, 2026 03:08
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from d697e55 to 9965f7d Compare October 2, 2026 03:16
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 6c0f2af to 9dbfd97 Compare October 2, 2026 03:16
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 9965f7d to 8f913ed Compare October 2, 2026 03:24
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 9dbfd97 to ed9c397 Compare October 2, 2026 03:24
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 8f913ed to cc222dd Compare October 2, 2026 03:38
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from ed9c397 to 4f01f65 Compare October 2, 2026 03:38
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from cc222dd to 9388c94 Compare October 2, 2026 04:05
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 4f01f65 to 77b4213 Compare October 2, 2026 04:05
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 9388c94 to ab74177 Compare October 2, 2026 04:08
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 77b4213 to 74d9f96 Compare October 2, 2026 04:08
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from ab74177 to e80f991 Compare October 2, 2026 04:14
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 74d9f96 to 17c4b38 Compare October 2, 2026 04:14
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from e80f991 to 8470ca9 Compare October 2, 2026 04:22
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 17c4b38 to 0c39190 Compare October 2, 2026 04:22
@huangjeff5
huangjeff5 force-pushed the feat/dotpromptz-python-handlebars branch from 8470ca9 to 54d7248 Compare October 2, 2026 04:54
Pin every action to a commit SHA, default the workflow token to
contents: read, and stop persisting checkout credentials in the jobs
that only read the repo. uv-lock-check keeps its credentials because it
pushes lockfile commits back to release-please branches.
@huangjeff5
huangjeff5 force-pushed the ci/python-workflow-hardening branch from 0c39190 to d7da1ae Compare October 2, 2026 04:54
@huangjeff5

Copy link
Copy Markdown
Collaborator Author

Absorbed into #620 so that all Python CI workflow hardening and SHA pinning land directly with the Handlebars package changes, resolving the GitHub Actions Scan findings.

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