Skip to content

ci: scope PR title workflow tokens and pin actions to commit SHAs - #640

Open
julianrubino wants to merge 2 commits into
developfrom
ci/pr-labeler-permissions
Open

julianrubino wants to merge 2 commits into
developfrom
ci/pr-labeler-permissions

Conversation

@julianrubino

@julianrubino julianrubino commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

What

Both PR title workflows get an explicit top-level permissions: block and their action pinned to a commit SHA:

  • pr-labeler.yaml: contents: read, pull-requests: write; ytanikin/pr-conventional-commits pinned to 8267db1bacc237419f9ed0228bb9d94e94271a1d (tag 1.4.1).
  • semantic-pr.yaml: pull-requests: read; amannn/action-semantic-pull-request pinned to e32d7e603df1aa1ba07e981f2a23455dee596825 (what v5 resolves to today, same SHA the current runs download).

Why

Part of the zeta-chain GitHub Actions hardening. Both workflows run with whatever the org default token grants, which today is write on everything (job logs 126180957933 and 144590615614). pr-labeler uses add_label: true, so it needs pull-requests: write; semantic-pr only reads the PR title. Declaring that now drops every other write scope and keeps both checks working once the org default workflow token goes read-only.

A tag can be moved to different code; a commit SHA cannot.

Checked on this PR

pr-labeler run on d89685a (job 144590613440): passed, token block Contents: read, Metadata: read, PullRequests: write, action downloaded at 8267db1b, and the CI label was added. Semantic PR run on 73b0044 (run 47200831864): passed, token block Metadata: read, PullRequests: read, action downloaded at e32d7e60.

Risk

Same action code, same triggers. Fork PRs already get a read-only token, so they behave as today.

Rollback

Revert.


Note

Low Risk
CI-only workflow configuration with least-privilege permissions and SHA-pinned actions; no application or runtime behavior changes.

Overview
Hardens the two PR title validation workflows by declaring explicit job token scopes and pinning third-party actions to immutable commit SHAs instead of movable tags.

pr-labeler.yaml now requests contents: read and pull-requests: write (for labeling) and pins ytanikin/pr-conventional-commits to 8267db1b…. semantic-pr.yaml limits access to pull-requests: read and pins amannn/action-semantic-pull-request to e32d7e60…. Behavior stays the same; default broad write permissions are dropped ahead of org-wide read-only workflow tokens.

Reviewed by Cursor Bugbot for commit 73b0044. Configure here.

@julianrubino

Copy link
Copy Markdown
Member Author

@codex review

@julianrubino

Copy link
Copy Markdown
Member Author

bugbot run

@github-actions github-actions Bot added the CI label Dec 3, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T22:26:55.716956Z 73b0044 Draft marked ready
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: d89685aa37

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

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@julianrubino julianrubino changed the title ci: scope pr-labeler token and pin action to commit SHA ci: scope PR title workflow tokens and pin actions to commit SHAs Dec 3, 2026
@julianrubino

Copy link
Copy Markdown
Member Author

@codex review

@julianrubino

Copy link
Copy Markdown
Member Author

bugbot run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 73b0044198

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

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 73b0044. Configure here.

@julianrubino
julianrubino marked this pull request as ready for review December 3, 2026 22:25
@julianrubino
julianrubino requested review from a team as code owners December 3, 2026 22:25
@julianrubino
julianrubino requested a review from morde08 December 3, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant