fix(ci): check out the repo for the /changelog Claude step - #10865
Merged
Conversation
The claude-code-action performs git operations (configure user, fetch origin main) that assume a checked-out repo. The changelog-command workflow had no checkout, so the step failed with git exit code 128 and, being continue-on-error, silently posted the fallback comment instead of a draft. Add a checkout of the default branch (never PR head, persist-credentials off); the PR content is still supplied only as the diff passed to the prompt.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the /changelog GitHub Actions workflow by ensuring the Claude changelog drafting step runs inside an actual checked-out git repository (required because claude-code-action performs git operations like git fetch).
Changes:
- Add an
actions/checkoutstep before collecting the PR diff and invokinganthropics/claude-code-action.
Process check (from PR metadata):
- Motivation/Solution/AI disclosure are present.
- No explicit issue link is included (the description references PR #10864, not an issue).
- No Tests section is included (understandable for a workflow-only change, but the template expectation still appears unmet).
The claude-code-action performs git operations (configure user, fetch origin main) that assume a checked-out repo. The changelog-command workflow had no checkout, so the step failed with git exit code 128 and, being continue-on-error, silently posted the fallback comment instead of a draft. Add a checkout of the default branch (never PR head, persist-credentials off), and grant contents: read so the job token can fetch; the PR content is still supplied only as the diff.
Member
Author
|
Follow-up from #10864 Also need this urgently merged and tested before the next release. Admin-merging |
/changelog Claude step
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.
Motivation
After the OIDC fix (#10864), the
/changelogClaude step still failed:claude-code-actionruns git operations (configure user,git fetch origin main) that assume a checked-out repo.changelog-command.ymlhad no checkout, so the step failed with git exit 128 and, beingcontinue-on-error, silently posted the fallback comment ("Could not draft… add by hand") instead of a draft.Solution
Add a checkout of the default branch before the Claude step, matching what the release job already does.
persist-credentialsis off and PR head is never checked out; the PR content is still supplied only as the diff passed in the prompt, so no PR or fork code is executed.AI Disclosure
AI tools were used: Claude diagnosed and wrote the fix.