Skip to content

Commit 3972906

Browse files
fix(ci): check out the repo for the /changelog Claude step (#10865)
* fix(ci): check out the repo for the /changelog Claude step 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. * fix(ci): check out the repo for the /changelog Claude step 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.
1 parent a990fa4 commit 3972906

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/changelog-command.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
timeout-minutes: 15
3030
permissions:
31+
contents: read
3132
pull-requests: write
3233
steps:
3334
- name: Acknowledge the command
@@ -39,6 +40,12 @@ jobs:
3940
set -euo pipefail
4041
gh api --method POST "repos/${REPOSITORY}/issues/comments/${COMMENT_ID}/reactions" -f content=+1 >/dev/null || true
4142
43+
# issue_comment checks out the default branch (never PR head), giving the Claude action
44+
# a git repo to operate in. The PR content is supplied as the diff below, not from here.
45+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
46+
with:
47+
persist-credentials: false
48+
4249
- name: Collect the PR diff
4350
id: diff
4451
env:

0 commit comments

Comments
 (0)