Skip to content

fix: add least-privilege permissions to workflows#876

Draft
eniayomi wants to merge 3 commits into
developmentfrom
fix/code-scanning-workflow-permissions
Draft

fix: add least-privilege permissions to workflows#876
eniayomi wants to merge 3 commits into
developmentfrom
fix/code-scanning-workflow-permissions

Conversation

@eniayomi
Copy link
Copy Markdown

Resolves the actions/missing-workflow-permissions warnings by adding least-privilege permissions blocks to all six workflows.

  • cla.yml: pull-requests/statuses: write for the CLA bot to comment/set status, actions: write so it can re-trigger itself. Signatures are written to the remote repo via the bot's PERSONAL_ACCESS_TOKEN, not GITHUB_TOKEN.
  • conventional-commit-check.yml: pull-requests: read is enough for amannn/action-semantic-pull-request to read the title.
  • deployment.yml: contents: read for checkout, pull-requests: write for the PR-URL comment job.
  • lint.yml, safe-apps-check.yml: contents: read.
  • safe-apps-e2e.yml: actions: write for styfle/cancel-workflow-action, contents: read for checkout.

eniayomi added 3 commits May 21, 2026 09:57
Resolve the actions/missing-workflow-permissions code-scanning warnings
by adding explicit permission blocks to each workflow.

- cla.yml: pull-requests/statuses write for the CLA bot, actions:write
  so it can re-trigger itself; signatures repo is written via the
  PERSONAL_ACCESS_TOKEN, not GITHUB_TOKEN.
- conventional-commit-check.yml: pull-requests:read is enough for
  amannn/action-semantic-pull-request to read the title.
- deployment.yml: contents:read for checkout, pull-requests:write for
  the PR-URL comment job.
- lint.yml, safe-apps-check.yml: contents:read.
- safe-apps-e2e.yml: actions:write for styfle/cancel-workflow-action,
  contents:read for checkout.
Org policy requires actions/missing-workflow-permissions PRs to also
have every action ref pinned to a full-length commit SHA. Without this,
CI fails before running with: 'the action X is not allowed in
safe-global/safe-react-apps because all actions must be pinned to a
full-length commit SHA'.

Pinned to the SHA of the existing tag/branch HEAD to preserve current
behavior. Upgrades to newer major versions (checkout v4/v5,
setup-node v4, cache v4, etc.) are out of scope for this PR.
The local setup-env composite action references actions/setup-node@v3
and aws-actions/configure-aws-credentials@v1 unpinned, which the
'Pull Request' workflow consumes via ./.github/actions/setup-env. The
org SHA-pin policy rejects them too.
@github-actions
Copy link
Copy Markdown

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