Skip to content

ci: declare contents:read on CI workflow - #102

Merged
danhill-stripe merged 1 commit into
stripe:mainfrom
arpitjain099:chore/ci-permissions
May 22, 2026
Merged

ci: declare contents:read on CI workflow#102
danhill-stripe merged 1 commit into
stripe:mainfrom
arpitjain099:chore/ci-permissions

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

The CI workflow installs pnpm, runs turbo build, biome, tests, and pnpm publish --dry-run. It never writes to the repo or comments on PRs. Right now it doesn't declare a permissions: block, so the workflow token gets whatever scope the repository default grants it.

Setting permissions: contents: read pins that to the minimum the steps actually use. Pattern matches:

  • release.yml -- workflow-level contents: write + pull-requests: write + id-token: write for changesets
  • issue-triggered-create-jira.yml -- workflow-level contents: read

So the same shape is already idiomatic here, just missing on ci.yml.

Third-party actions (pnpm/action-setup, actions/setup-node) are involved; capping the token narrows the blast radius if either is ever compromised (cf. tj-actions/changed-files CVE-2025-30066).

CI builds, typechecks, runs biome and pnpm tests, and finally
`pnpm publish --dry-run`. None of these reach beyond the working
tree. Declaring contents:read at workflow scope makes that intent
explicit and matches the workflow-level permissions blocks that
release.yml and issue-triggered-create-jira.yml already carry.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099
arpitjain099 requested a review from a team as a code owner May 14, 2026 00:56
@cla-assistant

cla-assistant Bot commented May 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented May 14, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@danhill-stripe
danhill-stripe merged commit 1bdbbe6 into stripe:main May 22, 2026
2 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.

2 participants