Skip to content

fix(ci): check out the repo for the /changelog Claude step - #10865

Merged
gustavovalverde merged 2 commits into
mainfrom
fix/changelog-command-checkout
Jul 1, 2026
Merged

fix(ci): check out the repo for the /changelog Claude step#10865
gustavovalverde merged 2 commits into
mainfrom
fix/changelog-command-checkout

Conversation

@gustavovalverde

Copy link
Copy Markdown
Member

Motivation

After the OIDC fix (#10864), the /changelog Claude step still failed: claude-code-action runs git operations (configure user, git fetch origin main) that assume a checked-out repo. changelog-command.yml had no checkout, so the step failed with git exit 128 and, being continue-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-credentials is 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.

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.
Copilot AI review requested due to automatic review settings July 1, 2026 01:41

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

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/checkout step before collecting the PR diff and invoking anthropics/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).

Comment thread .github/workflows/changelog-command.yml
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.
@gustavovalverde

Copy link
Copy Markdown
Member Author

Follow-up from #10864

Also need this urgently merged and tested before the next release.

Admin-merging

@gustavovalverde gustavovalverde changed the title fix(ci): check out the repo for the /changelog Claude step fix(ci): check out the repo for the /changelog Claude step Jul 1, 2026
@gustavovalverde
gustavovalverde merged commit 3972906 into main Jul 1, 2026
68 checks passed
@gustavovalverde
gustavovalverde deleted the fix/changelog-command-checkout branch July 1, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants