Skip to content

Commit 91ade3b

Browse files
authored
ci: declare minimum permissions on PR title workflow (#756)
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`. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
1 parent ab49faf commit 91ade3b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
pull_request:
44
types: [opened, edited, synchronize]
55

6+
permissions:
7+
contents: read
8+
pull-requests: read
9+
610
jobs:
711
lint:
812
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)