ci: set read-only default GitHub Actions permissions#5369
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request introduces a new CONTRIBUTING.md file and adds a 'Contributing' section to the README.md to guide contributors. The review feedback recommends removing a reference to signing commits (DCO) in CONTRIBUTING.md because the linked guide does not cover it, and renaming the redundant 'Contributing' link in README.md to 'Contribution Guide' for better clarity.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds clearer contributor-facing documentation entry points and updates GitHub Actions workflows to explicitly set GITHUB_TOKEN permissions.
Changes:
- Add a “Contributing” section to the README and introduce a root
CONTRIBUTING.md. - Add
permissions: read-allto multiple GitHub Actions workflows, with some jobs adding more specific permissions. - Adjust select workflows to set job-level permissions (e.g., packages/security-events).
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds a “Contributing” section with quick links. |
| CONTRIBUTING.md | Adds a root contribution entry-point file for GitHub discovery. |
| .github/workflows/workflows-approve.yaml | Sets workflow token permissions to read-all. |
| .github/workflows/sync-apis.yaml | Sets workflow token permissions to read-all. |
| .github/workflows/stale.yaml | Sets workflow token permissions to read-all. |
| .github/workflows/release_chart.yaml | Sets workflow token permissions to read-all. |
| .github/workflows/release.yaml | Sets workflow token permissions to read-all and adds job-level permissions for publishing. |
| .github/workflows/licenses_lint.yaml | Sets workflow token permissions to read-all. |
| .github/workflows/fossa.yml | Sets workflow token permissions to read-all. |
| .github/workflows/e2e_vcctl.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_spark.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_shard.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_sequence.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_scheduling_gates.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_scheduling_basic.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_scheduling_actions.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_parallel_jobs.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_hypernode.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_gangevict.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_dra.yml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_cronjob.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/e2e_admission.yaml | Adds workflow-level read-all and job-level permissions (two jobs). |
| .github/workflows/e2e.yaml | Sets workflow token permissions to read-all. |
| .github/workflows/docker_images.yaml | Adds workflow-level read-all and job-level permissions. |
| .github/workflows/codeql-analysis.yml | Adds workflow-level read-all and job-level permissions for CodeQL upload. |
| .github/workflows/code_verify.yaml | Sets workflow token permissions to read-all. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Contributing | ||
|
|
||
| - [Contributing](contribute.md) | ||
| - [Changelog](CHANGELOG.md) | ||
| - [Code of Conduct](code_of_conduct.md) | ||
| - [Security](SECURITY.md) | ||
| - [Maintainers](MAINTAINERS.md) |
| permissions: | ||
| contents: read | ||
| actions: read | ||
| actions: write |
| schedule: | ||
| - cron: '15 16 * * 3' | ||
|
|
||
| permissions: read-all |
| permissions: | ||
| contents: read | ||
| actions: read | ||
| security-events: write |
|
@kubeboiii Looks like after you changed some permission for CIs, some of CIs get blocked and didn't execute, please check |
|
Hi @kubeboiii and @JesseStutler, I looked into why the E2E CIs were blocked and failed to execute after the permissions changes. The issue is related to how GitHub Actions handles permissions with reusable workflows ( In GitHub Actions, a caller workflow must have permissions equal to or greater than the permissions requested by the reusable workflow it calls. Since The fix: # In e2e.yaml
jobs:
build-images:
uses: ./.github/workflows/docker_images.yaml
permissions:
contents: read
actions: writeHope this helps get the CIs running again! Let me know if you need any help testing it. |
There was a problem hiding this comment.
Remove this, currently we don't need in this pr
Thanks for reminding! @shivansh-gohem |
There was a problem hiding this comment.
Could you resolve the conflicts and push again @kubeboiii ?
|
Thanks to @shivansh-gohem , I think the e2e workflows still need one more change. @kubeboiii For reusable workflows, the called workflow cannot elevate You should also grant the required permissions on the reusable workflow call jobs in jobs:
build-images:
permissions:
contents: read
actions: write
uses: ./.github/workflows/docker_images.yaml
e2e-admission:
needs: build-images
permissions:
contents: read
actions: write
uses: ./.github/workflows/e2e_admission.yamlSame for the other e2e reusable workflow calls that need to upload artifacts. Keeping top-level |
There was a problem hiding this comment.
No need to add a seperate new CONTRIBUTING.md. Just rename the current existing contribute.md -> contributing.md
There was a problem hiding this comment.
Or maybe this rename work can allow #5390 to do that, this PR only to fix the permission of workflows
|
Hi @JesseStutler! I'd love to help out more and build trust within the community. Are there any other parts of this issue or other open issues you'd recommend I tackle next? Let me know if there's anything specific you need a hand with! |
d365309 to
b62cd49
Compare
Set permissions: read-all at workflow scope on top-level CI workflows. Grant job-level write scopes only where required (release, CodeQL, e2e artifacts, sync-apis, stale, workflows-approve). Reusable workflow_call files keep minimal job permissions only so e2e.yaml caller jobs can pass contents:read and actions:write without triggering GitHub reusable-workflow validation errors. Signed-off-by: Himanshu <144804569+kubeboiii@users.noreply.github.com>
b62cd49 to
f82741e
Compare
What type of PR is this?
/kind documentation
What this PR does / why we need it
Part of #5366 (improve CLOMonitor score). Sets explicit GitHub Actions
token permissions:
permissions: read-allat workflow scope on top-level CI workflows(unchanged:
scorecards.yml)security-events, e2e artifacts, sync-apis, stale, workflows-approve)
e2e.yamlpasscontents: readandactions: writeto reusable workflowsworkflow_callfiles use minimal job permissions only (noworkflow-level
read-all) so GitHub validates caller/called permissionscopes correctly
Contributing guide detection is tracked separately in #5390.
Which issue(s) this PR fixes
Part of #5366
Special notes for your reviewer
Rebased onto current master. Permissions-only scope per review; no README
or CONTRIBUTING changes.
Reusable workflows no longer declare workflow-level
read-all, whichwas causing E2E Tests startup failure when combined with caller job
permissions.
Does this PR introduce a user-facing change?
NONE