Harden CI workflows#1745
Merged
Merged
Conversation
/cherry-pick Signed-off-by: Tamal Saha <tamal@appscode.com>
The hardened workflow uses actions/checkout@v4 which defaults to fetch-depth: 1, so `git branch -r | grep release` in hack/scripts/cherry-pick.sh returned nothing and the loop body never executed. Cherry-pick PRs stopped being created after #1732. Signed-off-by: Tamal Saha <tamal@appscode.com>
actions/checkout defaults to persist-credentials: true, which leaves an http.extraheader with the workflow's GITHUB_TOKEN in git config. That overrides the LGTM token in the URL set by `git remote set-url`, so `git push` fails with "Permission denied to github-actions[bot]" when pushing the cherry-pick branch. Signed-off-by: Tamal Saha <tamal@appscode.com>
b63c876 to
04d810b
Compare
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
tamalsaha
added a commit
that referenced
this pull request
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetch-depth: 0lets the script see release branches.persist-credentials: falsestops actions/checkout from leaving anhttp.extraheaderwith the workflow'sGITHUB_TOKEN, which otherwise overrides the LGTM token in the remote URL and causes the push to fail withPermission denied to github-actions[bot].Background
The hardened cherry-pick workflow switched to
actions/checkout@v4.3.1, whose defaults broke the originalcherry-pick.shin two ways:fetch-depth: 1hid allorigin/release-*refs, so the loop body never ran (run26143101071— 12s, no script output).persist-credentials: trueleft agithub-actions[bot]extraheader that overrode the LGTM token set viagit remote set-url, so the push step 403'd (run26143763790).Both are addressed in this PR.
/cherry-pick
🤖 Generated with Claude Code