Skip to content

[release-24.0] CI: tighten workflow token permissions and checkout credentials (#20785) - #20796

Merged
arthurschreiber merged 2 commits into
release-24.0from
backport-20785-to-release-24.0
Aug 5, 2026
Merged

[release-24.0] CI: tighten workflow token permissions and checkout credentials (#20785)#20796
arthurschreiber merged 2 commits into
release-24.0from
backport-20785-to-release-24.0

Conversation

@vitess-bot

@vitess-bot vitess-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

This is a backport of #20785

Copilot AI balanced review requested due to automatic review settings August 4, 2026 18:04
@vitess-bot vitess-bot Bot added Component: Build/CI Backport This is a backport Skip CI Skip CI actions from running Merge Conflict Type: Security labels Aug 4, 2026
@vitess-bot

vitess-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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 origin by the name of the vitessio/vitess remote

git fetch --all
gh pr checkout 20796
git reset --hard origin/release-24.0
git cherry-pick -m 1 b9592239c4bc9eab0fe12a8a53b9c66fa11ce6fd

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-all with least-privilege contents: read in 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.

Comment on lines +25 to +33
<<<<<<< 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))
Comment on lines +6 to +7
permissions:
contents: read
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ matrix.branch }}
persist-credentials: 'false'
@arthurschreiber arthurschreiber self-assigned this Aug 4, 2026
@github-actions github-actions Bot added this to the v24.0.3 milestone Aug 4, 2026
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>
@arthurschreiber arthurschreiber removed Skip CI Skip CI actions from running Merge Conflict labels Aug 4, 2026
Copilot AI review requested due to automatic review settings August 4, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

@arthurschreiber

Copy link
Copy Markdown
Member

Resolved the conflicts.

The only real conflict was in error_code_docs_generate.yml, and it was about the checkout pin: this branch is on actions/checkout v6.0.2 where main is on v7.0.0. I kept this branch's pin and applied only what #20785 adds there, persist-credentials: 'false' — a backport shouldn't bump an action version.

One deliberate deviation from a straight backport: I folded in #20792, which adds permission-workflows: write to the app token in backport.yml. #20785 is what removed that permission (by scoping a token that previously inherited everything), and it broke backporting of any CI change on main until #20792 landed. Backporting #20785 alone would have carried the same regression here, so the two belong together.

All 8 files from #20785 are present, no conflict markers remain, and no Go files change.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@arthurschreiber
arthurschreiber merged commit 5fb68fb into release-24.0 Aug 5, 2026
231 of 233 checks passed
@arthurschreiber
arthurschreiber deleted the backport-20785-to-release-24.0 branch August 5, 2026 12:21
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.

3 participants