Skip to content

ci: declare contents:read on CI Typescript workflow#491

Open
arpitjain099 wants to merge 1 commit into
Shopify:mainfrom
arpitjain099:chore/ci-typescript-permissions
Open

ci: declare contents:read on CI Typescript workflow#491
arpitjain099 wants to merge 1 commit into
Shopify:mainfrom
arpitjain099:chore/ci-typescript-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

The CI Typescript workflow's single build job runs pnpm install + the build script inside lang/typescript. No GitHub API write, no cache directive, no comment-on-PR step.

This patch pins it to permissions: contents: read at workflow scope. Style matches the per-job permission block already declared in npm-release.yml (id-token: write + contents: write + pull-requests: write for the npm publish path).

With explicit scope:

  • the workflow token can't be widened by a future change to the repo default
  • the SLSA / OpenSSF Scorecard Token-Permissions check passes for this file
  • third-party action exposure (pnpm/action-setup, actions/setup-node) is bounded to read

ci.yml is the other workflow without an explicit permissions: block, but it uses ruby/setup-ruby with bundler-cache: true, which interacts with the cache-save path and deserves a separate look.

No behavioural change.

The Build Typescript job runs pnpm install + builds inside
lang/typescript. No GitHub API write beyond actions/checkout.
contents:read is the floor.

Style matches the per-job permissions block in npm-release.yml
(id-token:write + contents:write + pull-requests:write for the
release path).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant