Skip to content

ci: declare minimum permissions on lint-pr-name workflow#109

Closed
arpitjain099 wants to merge 1 commit into
spotify:mainfrom
arpitjain099:chore/lint-pr-name-permissions
Closed

ci: declare minimum permissions on lint-pr-name workflow#109
arpitjain099 wants to merge 1 commit into
spotify:mainfrom
arpitjain099:chore/lint-pr-name-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

The lint-pr-name workflow runs on pull_request_target, which means the workflow's GITHUB_TOKEN defaults to the broader scopes used for pushes to the default branch, not the read-only scope used for pull_request from a fork.

This patch pins the token to the minimum it actually needs:

  • contents: read so the third-party actions can still resolve refs.
  • pull-requests: write so marocchino/sticky-pull-request-comment can post (and later delete) the lint-error comment.

The two actions invoked here (amannn/action-semantic-pull-request, marocchino/sticky-pull-request-comment) are third-party, so explicitly capping the token's authority narrows the blast radius if either is ever compromised (cf. CVE-2025-30066 / tj-actions/changed-files).

The style matches pull-requests.yaml, which already declares a workflow-level permissions: block.

No behavioural change, just a tighter token. Happy to adjust the layout if a per-job block is preferred.

The lint-pr-name workflow triggers on pull_request_target, which runs
with the default GITHUB_TOKEN scopes for the base repo rather than the
read-only scopes used for pull_request from forks. Pinning the token
to contents:read + pull-requests:write narrows the blast radius if a
referenced third-party action (amannn/action-semantic-pull-request,
marocchino/sticky-pull-request-comment) is ever compromised, while
preserving the comment-sticky behaviour the job already relies on.

This mirrors the style used in pull-requests.yaml (workflow-level
permissions block).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099
Copy link
Copy Markdown
Author

Hi @andreas-karlsson, gentle ping on this. PR has been open for 4 days without review. I noticed you've been on the recent-merger side of recent merges in this repo. When you have a moment, would you mind giving it a quick look? No urgency. Happy to address any feedback.

@nicklasl
Copy link
Copy Markdown
Member

Thanks for the contribution and for flagging the permissions hardening — we appreciate the security awareness!

We'll look into this and handle it internally. For future contributions to this repo, please refer to our contribution guidelines.

@nicklasl nicklasl closed this May 18, 2026
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.

2 participants