claude-code-action icon indicating copy to clipboard operation
claude-code-action copied to clipboard

[BUG] CLAUDE_APP_BOT_ID constant uses github-actions[bot] ID (41898282) instead of claude[bot] ID (209825114)

Open HipHoff opened this issue 11 months ago • 2 comments

Describe the bug

The CLAUDE_APP_BOT_ID constant in src/github/constants.ts is set to 41898282, which is actually the ID for github-actions[bot], not claude[bot].

The correct ID for claude[bot] is 209825114.

Evidence

Verified via GitHub API:

{"id": 41898282, "login": "github-actions[bot]", "type": "Bot"}
{"id": 209825114, "login": "claude[bot]", "type": "Bot"}

Looking at action.yml, the defaults are:

  • bot_id: "41898282" ← WRONG (this is github-actions[bot])
  • bot_name: "claude[bot]" ← Correct name, but mismatched with ID

Impact

When commits are made via git CLI (fallback when API commit signing fails), the commits have:

  • Author: 41898282+claude[bot]@users.noreply.github.com
  • This creates an identity mismatch and results in unsigned commits

Compare to correctly-signed commits made via GitHub API:

  • Author: 209825114+claude[bot]@users.noreply.github.com
  • Committer: GitHub <[email protected]>
  • These are verified/signed by GitHub

Reproduction

  1. Enable use_commit_signing: true in a workflow
  2. Trigger Claude to make a commit
  3. In some cases, commits fall back to git CLI instead of API
  4. These commits show as unsigned in GitHub

Workaround

Explicitly set the correct bot_id in workflow:

- uses: anthropics/claude-code-action@v1
  with:
    use_commit_signing: true
    bot_id: "209825114"  # ← Workaround: correct claude[bot] ID

Suggested Fix

Update src/github/constants.ts:

// Before (incorrect)
export const CLAUDE_APP_BOT_ID = 41898282;

// After (correct)
export const CLAUDE_APP_BOT_ID = 209825114;

And update the default in action.yml:

bot_id:
  description: "GitHub user ID to use for git operations"
  required: false
  default: "209825114"  # claude[bot] ID

Related

This may be related to #281 / #282 (commits not verified), though those issues focus on when git CLI is used rather than the incorrect bot ID.

HipHoff avatar Dec 20 '25 00:12 HipHoff

~~It looks like this also breaks use_sticky_comment as it's trying to find comments from the wrong user ID.~~ Unrelated, sorry!

nsheaps avatar Dec 20 '25 03:12 nsheaps

Confirming this reproduces without use_commit_signing — on the plain @claude interactive path in anthropics/claude-code-action@v1 (tested 2026-04-12).

Scenario:

  • anthropics/claude-code-action@v1 with just claude_code_oauth_token — no use_commit_signing, no ssh_signing_key
  • apps/claude GitHub App installed on the target repo so the action can exchange the OAuth token for a Claude App installation token
  • @claude mentioned in an issue → action runs → Claude produces a git commit + git push via the built-in git-push.sh path that the default tool set allows

Observed (using the default bot_id: "41898282"):

commit.author.name:  "claude[bot]"
commit.author.email: "41898282+claude[bot]@users.noreply.github.com"
                      ^^^^^^^^
                      this is github-actions[bot]'s id, not claude[bot]'s

(GitHub REST `commits/<sha>` response)
github.author.login: "github-actions[bot]"
github.author.id:    41898282

After applying the workaround (explicit bot_id: "209825114" + bot_name: "claude[bot]" inputs), re-running the same flow:

commit.author.email: "209825114+claude[bot]@users.noreply.github.com"
github.author.login: "claude[bot]"
github.author.id:    209825114

Same two successful claude-code-action runs back-to-back, only difference was the bot_id override, and the GitHub-side attribution flipped from github-actions[bot] to claude[bot].

So the bug isn't signing-specific. bot_id gets baked into the git author email format <id>+<name>@users.noreply.github.com regardless of whether the signing path is enabled, and GitHub's author resolution uses only the numeric prefix. Incorrect default → wrong attribution.

Additional impacts beyond unsigned commits that this causes on the plain path:

  1. Commits show up under github-actions[bot] in the repo's contributor list, even though git log locally shows claude[bot] as the author name
  2. Filtering commits by author claude[bot] on the commits page returns zero results even when @claude has been making commits
  3. The claude[bot] avatar never renders next to its own commits in the UI
  4. GitHub event webhooks for these commits fire under the wrong bot identity, which can confuse downstream integrations that whitelist by bot name

Agreed with the suggested fix in the OP — looks like a 1-line change in src/github/constants.ts + matching default in action.yml. Happy to submit a PR if that would help move it forward.

tonyzdev avatar Apr 11 '26 20:04 tonyzdev