[release-24.0] CI: tighten workflow token permissions and checkout credentials (#20785) - #20796
Conversation
|
Hello @arthurschreiber, there are conflicts in this backport. Please address them in order to merge this Pull Request. You can execute the snippet below to reset your branch and resolve the conflict manually. Make sure you replace |
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
Updates GitHub Actions workflows to tighten default token permissions and avoid persisting checkout credentials.
Changes:
- Replace broad
permissions: read-allwith least-privilegecontents: readin several workflows. - Disable persisted Git credentials during checkout in update-related workflows.
- Add scoped job permissions for Slack notification job.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/update_golang_version.yml | Disables persisted checkout credentials for the matrix branch checkout. |
| .github/workflows/pr_opened_tasks.yml | Narrows workflow token permissions from read-all to contents: read. |
| .github/workflows/error_code_docs_generate.yml | Attempts to update checkout action and disable persisted credentials (currently contains conflict markers). |
| .github/workflows/docker_lite_build_check.yml | Narrows workflow token permissions from read-all to contents: read. |
| .github/workflows/docker_build_images.yml | Narrows workflow token permissions and adds job-level actions: read for Slack notification. |
| .github/workflows/create_release.yml | Updates the comment describing the release asset action version pin. |
| .github/workflows/cluster_endtoend.yml | Narrows workflow token permissions from read-all to contents: read. |
| .github/workflows/backport.yml | Requests additional permissions for the GitHub App token used in backport automation. |
| <<<<<<< HEAD | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| ||||||| parent of b9592239c4 (CI: tighten workflow token permissions and checkout credentials (#20785)) | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| ======= | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: 'false' | ||
| >>>>>>> b9592239c4 (CI: tighten workflow token permissions and checkout credentials (#20785)) |
| permissions: | ||
| contents: read |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ matrix.branch }} | ||
| persist-credentials: 'false' |
Keep this branch's pinned checkout action in error_code_docs_generate.yml and add only the persist-credentials setting that #20785 introduces; the conflict was the action version, which a backport should not bump. Also fold in #20792, which adds the workflows permission to the token in backport.yml. #20785 removed it by scoping the token, and shipping that state here would carry the same regression onto this branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
|
Resolved the conflicts. The only real conflict was in One deliberate deviation from a straight backport: I folded in #20792, which adds All 8 files from #20785 are present, no conflict markers remain, and no Go files change. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Description
This is a backport of #20785