Skip to content

ci: declare minimum permissions on PR title workflow - #861

Merged
styfle merged 1 commit into
vercel:mainfrom
arpitjain099:chore/declare-workflow-perms-1778777959-47
Jun 9, 2026
Merged

ci: declare minimum permissions on PR title workflow#861
styfle merged 1 commit into
vercel:mainfrom
arpitjain099:chore/declare-workflow-perms-1778777959-47

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

Declares permissions: contents: read, pull-requests: read at the workflow level. The job's single step runs a PR-title validator (amannn/action-semantic-pull-request or equivalent) which reads the PR title via the pulls API and reports the result as the workflow's own check status. That needs read on pull-requests and nothing else.

The reason to be explicit even when the inherited default may already be reasonable is CVE-2025-30066, the March 2025 tj-actions/changed-files compromise where a tampered third-party action exfiltrated GITHUB_TOKEN from workflow logs. The leaked token carried whatever scope was issued at the workflow level, so per-workflow caps bound the runtime blast radius regardless of repo or org default. The block also gives drift protection if that default ever widens and is what OpenSSF Scorecard's Token-Permissions check looks for.

YAML validated locally with yaml.safe_load.

@arpitjain099
arpitjain099 requested a review from ijjk as a code owner May 14, 2026 16:59
@arpitjain099

Copy link
Copy Markdown
Contributor Author

@ijjk / @styfle - PR has approval and is green. Any chance of a merge when convenient?

Comment thread .github/workflows/prs.yml Outdated
@styfle

styfle commented May 26, 2026

Copy link
Copy Markdown
Member

The read content permission is not necessary. Also you need to sign your commits before we can merge.

@arpitjain099
arpitjain099 force-pushed the chore/declare-workflow-perms-1778777959-47 branch from 3964c6f to ff57abc Compare June 2, 2026 01:07
@socket-security

socket-security Bot commented Jun 2, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

The Lint PR workflow only reads the pull request to validate its title via
amannn/action-semantic-pull-request, so scope GITHUB_TOKEN to
pull-requests: read.

Co-authored-by: Steven <steven@ceriously.com>
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099
arpitjain099 force-pushed the chore/declare-workflow-perms-1778777959-47 branch from ff57abc to b599848 Compare June 2, 2026 01:08
@arpitjain099

Copy link
Copy Markdown
Contributor Author

Thanks @styfle, both addressed:

  • Dropped contents: read (you're right, the title check only reads the PR, so pull-requests: read is all it needs). Kept your change and credited you on the commit.
  • Re-signed: the branch is now a single SSH-signed, DCO signed-off commit, so it shows as Verified.

Rebased onto current main while I was at it. Should be ready to merge whenever convenient.

@styfle
styfle enabled auto-merge (squash) June 9, 2026 16:20
@styfle
styfle merged commit a737ac4 into vercel:main Jun 9, 2026
4 checks passed
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.

3 participants