Skip to content

ci: restrict GITHUB_TOKEN to read-only in core CI workflows#14834

Open
Rohan5commit wants to merge 1 commit intoKong:masterfrom
Rohan5commit:ci/restrict-github-token-core-workflows
Open

ci: restrict GITHUB_TOKEN to read-only in core CI workflows#14834
Rohan5commit wants to merge 1 commit intoKong:masterfrom
Rohan5commit:ci/restrict-github-token-core-workflows

Conversation

@Rohan5commit
Copy link
Copy Markdown

Summary

  • add explicit top-level workflow permissions:
    • permissions: { contents: read }
  • apply to core read-only CI workflows:
    • .github/workflows/build.yml
    • .github/workflows/build_and_test.yml
    • .github/workflows/buildifier.yml
    • .github/workflows/ast-grep.yml
    • .github/workflows/changelog-requirement.yml
    • .github/workflows/changelog-validation.yml
    • .github/workflows/copyright-check.yml

Why

These workflows currently rely on repository-default GITHUB_TOKEN scope. Explicit read-only defaults reduce blast radius from compromised workflow code/actions and move toward least-privilege guidance.

Relates to #14778.

Notes

  • This PR intentionally targets core CI/lint/read-only workflows first.
  • Release/automation workflows with write needs are left unchanged in this patch.

@CLAassistant
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants