Skip to content

ci: declare least-privilege permissions in workflows#354

Merged
chalin merged 3 commits into
cncf:mainfrom
arpitjain099:ci/add-permissions
Jun 3, 2026
Merged

ci: declare least-privilege permissions in workflows#354
chalin merged 3 commits into
cncf:mainfrom
arpitjain099:ci/add-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Pins the default GITHUB_TOKEN on the four workflows still inheriting org defaults:

  • format-check.yml, link-check.yml, spell-check.ymlcontents: read. PR-time read-only checks (npm run check:format/markdown/links/spelling).
  • trigger-contribute-site-netlify.ymlpermissions: {}. The job only POSTs to NETLIFY_CONTRIBUTE_SITE_BUILD_HOOK; no checkout, no GitHub API calls.

YAML validated locally.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for cncf-techdocs ready!

Name Link
🔨 Latest commit 0ecc5ec
🔍 Latest deploy log https://app.netlify.com/projects/cncf-techdocs/deploys/6a203c809df3cb0008d20667
😎 Deploy Preview https://deploy-preview-354--cncf-techdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- format-check, link-check, spell-check: contents: read (PR-time
  read-only checks).
- trigger-contribute-site-netlify: permissions: {} (only POSTs to the
  Netlify build webhook).

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

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens GitHub Actions least-privilege settings by explicitly declaring GITHUB_TOKEN permissions on the remaining workflows that were inheriting broader org defaults.

Changes:

  • Set permissions: {} for the Netlify build-hook workflow that only POSTs to an external webhook.
  • Set permissions: contents: read for formatting, link, and spelling check workflows that checkout the repo and run read-only validation scripts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/trigger-contribute-site-netlify.yml Declares zero GITHUB_TOKEN permissions for a webhook-only workflow.
.github/workflows/spell-check.yml Restricts token scope to contents: read for PR-time spelling checks.
.github/workflows/link-check.yml Restricts token scope to contents: read for PR-time link checks.
.github/workflows/format-check.yml Restricts token scope to contents: read for PR-time formatting/markdown lint checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

arpitjain099 and others added 2 commits May 26, 2026 16:16
Signed-off-by: Patrice Chalin <chalin@users.noreply.github.com>
@chalin chalin changed the title ci: declare least-privilege permissions on the 4 remaining workflows ci: declare least-privilege permissions in workflows Jun 3, 2026
Copy link
Copy Markdown
Collaborator

@chalin chalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@chalin chalin merged commit f56bd9b into cncf:main Jun 3, 2026
9 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