Skip to content

ci: pin action refs and limit workflow token permissions - #5387

Draft
eval-exec wants to merge 3 commits into
nervosnetwork:developfrom
eval-exec:ci/workflow-maintenance
Draft

eval-exec wants to merge 3 commits into
nervosnetwork:developfrom
eval-exec:ci/workflow-maintenance

Conversation

@eval-exec

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Most workflow action references use mutable tags or branches, several workflows do not declare token permissions, and a few steps interpolate workflow event fields directly into shell commands.

What is changed and how it works?

  • Pin all action references to full commit SHAs (actions/*, docker/login-action, dependabot/fetch-metadata, release-plz/action, rust-lang/crates-io-auth-action, sarisia/actions-status-discord, xt0rted/pull-request-comment-branch, and dtolnay/rust-toolchain).
  • Add permissions: contents: read as the default for CI workflows that did not declare permissions.
  • Pass the pull request title, review branch name, and repository dispatch number through environment variables and validate them before use.
  • Pin the nervosnetwork/ckb-integration-test checkout in the benchmark workflow to a commit.
  • Set persist-credentials: false in the release-plz checkout.

Related changes

  • The scheduled audit workflow is handled in ci: use maintained cargo-audit action in scheduled audit #5386.
  • ckb-integration-test.yml references a reusable workflow that is no longer present in nervosnetwork/ckb-integration-test@main; this is left unchanged.
  • Release packaging and Docker publishing still rely on tag and branch permissions configured outside these files.

Check List

Tests

  • No code; workflows were checked with actionlint (no structural errors beyond existing shellcheck style notes and custom runner labels).

Side effects

  • None

Pin every action reference to a full commit SHA and declare contents: read for workflows that did not set token permissions.
Pass the pull request title, review branch name, and dispatch number through environment variables, validate them before use, and pin the benchmark checkout to a commit.
Set persist-credentials to false so the checkout token is not left in the git configuration for later steps.
@eval-exec
eval-exec requested a review from a team as a code owner November 23, 2026 06:16
@eval-exec
eval-exec requested review from zhangsoledad and removed request for a team November 23, 2026 06:16
@eval-exec
eval-exec marked this pull request as draft November 23, 2026 06:20

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