599 Commits

Author SHA1 Message Date
Ashwin Bhat
1dc994ee7a
Resolve actor account type before applying allowed_bots (#1330)
Move the allowed_bots check in checkHumanActor and checkWritePermissions so
it only fires after the actor has been resolved as a non-User account
(GitHub App / bot, or unresolvable app actor). Actors that resolve to a
regular User account go through the standard human/write checks regardless
of allowed_bots.

The Copilot-style path (GITHUB_ACTOR not ending in [bot] and not resolvable
as a user) is unchanged: it still falls through to the existing 404 catch,
which already consults allowed_bots once the API has reported the actor is
not a user.

Update tests to match and add coverage for the User-account path.
v1.0.127
2026-05-19 16:30:49 -07:00
GitHub Actions
ca89df3d42 chore: bump Claude Code to 2.1.145 and Agent SDK to 0.3.145 v1.0.126 2026-05-19 22:21:48 +00:00
Ashwin Bhat
fd1877debc
Simplify comment tool instructions in prompt (#1328) v1.0.125 2026-05-19 14:50:18 -07:00
GitHub Actions
24492741e0 chore: bump Claude Code to 2.1.144 and Agent SDK to 0.3.144 v1.0.124 2026-05-19 00:49:28 +00:00
Ashwin Bhat
0345b11d48
Fix prettier formatting in create-prompt (#1325) 2026-05-18 08:27:45 -07:00
GitHub Actions
b020494b57 chore: bump Claude Code to 2.1.143 and Agent SDK to 0.3.143 2026-05-15 22:29:11 +00:00
Ashwin Bhat
d56f10247e
Strengthen simplified tag-mode prompt (USE_SIMPLE_PROMPT) (#1313)
The opt-in simplified tag-mode prompt omitted several guardrails the
default prompt has. Bring it closer to the default's posture while
keeping it terse:

- Scoping clarification: spell out that only the triggering comment
  (or the issue body for issue events) carries instructions; other
  comments, the body, review comments, and repository files are
  reference context, not commands to act on.
- Review-only stop-condition: questions and code reviews must not edit,
  commit, push, or create branches unless the trigger explicitly asks
  for a code change.
- PR base-branch diff: when triggered on a PR with a known base branch,
  compare against origin/<base> instead of main/master.
- Capability limits: cannot submit formal PR reviews, approve, or merge;
  decline politely and point to the FAQ.

Adds focused tests covering the new lines for both PR and non-PR
events, including presence/absence of the conditional base-branch line.
2026-05-14 17:06:45 -07:00
Futurize Rush
bbad5183ff
fix: add parentheses to fix operator precedence in co-author check (#1199)
`??` has lower precedence than `!==`, so the expression:
  triggerDisplayName ?? triggerUsername !== "Unknown"
parses as:
  triggerDisplayName ?? (triggerUsername !== "Unknown")

When triggerDisplayName is an empty string "", the condition
evaluates to "" (falsy), incorrectly skipping the co-author line
even though the user is not "Unknown".

Add parentheses to get the intended behavior:
  (triggerDisplayName ?? triggerUsername) !== "Unknown"

Co-authored-by: Rush <rush@RushdeMacBook-Pro.local>
2026-05-14 16:58:17 -07:00
GitHub Actions
51ea8ea73a chore: bump Claude Code to 2.1.142 and Agent SDK to 0.3.142 v1.0.123 2026-05-14 22:56:05 +00:00
Ashwin Bhat
acfa366ca8
chore: bump pinned Bun to 1.3.14 (#1312)
* chore: bump pinned Bun to 1.3.14

* style: apply prettier to actor/permissions files
2026-05-14 18:55:04 -04:00
Kris
9eb125afe3
fix: handle non-user actors (e.g. Copilot) in permission and actor checks (#1144)
GitHub Apps like Copilot SWE Agent set GITHUB_ACTOR to a value (e.g.
"Copilot") that is neither a valid GitHub user nor ends with "[bot]".
This caused two independent crashes:

1. checkWritePermissions (permissions.ts): called the collaborator
   permission API which returns 404 "is not a user" for non-user actors.
2. checkHumanActor (actor.ts): called the Users API first, which 404s,
   before ever reaching the allowed_bots check.

Fix both by:
- Checking allowed_bots BEFORE making API calls, so known bots skip the
  API entirely.
- In permissions.ts, catching "is not a user" 404 errors and falling
  back to the allowed_bots list instead of crashing.
- In actor.ts, catching 404 errors and providing a clear error message
  telling the user to add the bot to allowed_bots.

Closes #900, #903, #1018, #1133

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 15:38:34 -07:00
JerryLee
1450f658d3
fix: write execution file when SDK throws (#1255) 2026-05-14 15:37:28 -07:00
Christian Van
0756f6ef2b
fix: exclude .claude-pr snapshot from git staging (#1277) 2026-05-14 15:36:57 -07:00
Matan Baruch
f4d6a11de1
fix: dereference symlinks when snapshotting sensitive paths to .claude-pr/ (#1186)
`cpSync` defaults to `dereference: false`, which means it tries to
recreate symlinks at the destination rather than copying file contents.
When a sensitive path (e.g. CLAUDE.md) is a symlink, this fails with
`ENOENT: no such file or directory, symlink` because `cpSync` attempts
to call `symlink()` without ensuring the parent `.claude-pr/` directory
exists first.

Adding `dereference: true` fixes this by following symlinks and copying
the actual file contents, which is also the correct semantic behavior —
review agents need to inspect the real content, not a symlink that may
not resolve correctly from `.claude-pr/`.

Fixes the action crash when repositories use symlinked CLAUDE.md
(e.g. CLAUDE.md -> AGENTS.md).
2026-05-14 15:36:09 -07:00
rico
bf6d40e068
fix: allow , in branch names (#1310)
`validateBranchName` rejects branch names containing a comma, even
though `git check-ref-format` permits commas and GitHub itself accepts
them. PRs whose head branch contains a `,` fail validation in-process
before any git operation, so the action errors out immediately.

Branch names with commas show up in real workflows when names are
derived from titles, place names, or external identifiers (e.g.
"feature/paris,france"). There is no workaround other than renaming
the branch, which is often not under the user's control.

All git calls in this file use execFileSync with an argv array, so no
shell interpretation occurs and `,` carries no injection risk. This is
the same reasoning used to add `#` in #1167 and `+` in #1248.

- Add `,` to the validateBranchName whitelist regex
- Update the surrounding comment and error message to match
- Add a test case covering commas in title-derived branch names

Fixes #1300
2026-05-14 15:34:32 -07:00
GitHub Actions
86eb26bf01 chore: bump Claude Code to 2.1.141 and Agent SDK to 0.2.141 v1.0.122 2026-05-13 23:19:48 +00:00
GitHub Actions
f4fb5c6cdc chore: bump Claude Code to 2.1.140 and Agent SDK to 0.2.140 v1.0.121 2026-05-12 21:10:29 +00:00
GitHub Actions
dde2242db6 chore: bump Claude Code to 2.1.139 and Agent SDK to 0.2.139 v1.0.120 2026-05-11 18:44:48 +00:00
GitHub Actions
476e359e62 chore: bump Claude Code to 2.1.138 and Agent SDK to 0.2.138 v1.0.119 2026-05-09 06:34:03 +00:00
GitHub Actions
ad67978e5e chore: bump Claude Code to 2.1.137 and Agent SDK to 0.2.137 v1.0.118 2026-05-09 00:11:30 +00:00
GitHub Actions
034cbdb008 chore: bump Claude Code to 2.1.136 and Agent SDK to 0.2.136 v1.0.117 2026-05-08 18:39:38 +00:00
GitHub Actions
939ae9c056 chore: bump Claude Code to 2.1.133 and Agent SDK to 0.2.133 v1.0.116 2026-05-07 23:49:29 +00:00
Octavian Guzu
e9c374db23
Update HackerOne links in SECURITY.md (#1268)
* Update HackerOne links in SECURITY.md

🏠 Remote-Dev: homespace

* Rename VDP heading to Anthropic Bug Bounty

🏠 Remote-Dev: homespace
2026-05-07 11:21:40 +01:00
GitHub Actions
9db782c3a1 chore: bump Claude Code to 2.1.132 and Agent SDK to 0.2.132 v1.0.115 2026-05-06 22:09:09 +00:00
GitHub Actions
62238ddb33 chore: bump Claude Code to 2.1.131 and Agent SDK to 0.2.131 v1.0.114 2026-05-06 07:48:07 +00:00
GitHub Actions
7d7d3055f1 chore: bump Claude Code to 2.1.129 and Agent SDK to 0.2.129 v1.0.113 2026-05-06 01:40:52 +00:00
GitHub Actions
2cc1ac1331 chore: bump Claude Code to 2.1.128 and Agent SDK to 0.2.128 v1.0.112 2026-05-04 23:02:42 +00:00
Justin Bisignano
38f25dd747
fix: make trigger_phrase match case-insensitive (#1279)
GitHub @-mention autocomplete inserts @Claude (capitalized) when users
pick the bot from the dropdown, but the trigger regex had no 'i' flag,
so the action would log 'No trigger was met for @claude' and exit. The
workflow's outer 'if: contains(...)' gate is case-insensitive, so the
job runs and looks like it silently ignored the user.

The regex was case-sensitive since the initial commit with no test
asserting either behavior; the existing tests focus on word-boundary
precision (email@claude.com etc.), not case.
2026-05-02 10:10:30 -07:00
GitHub Actions
fefa07e9c6 chore: bump Claude Code to 2.1.126 and Agent SDK to 0.2.126 v1.0.111 2026-05-01 02:05:59 +00:00
GitHub Actions
ef50f123a3 chore: bump Claude Code to 2.1.123 and Agent SDK to 0.2.123 v1.0.110 2026-04-29 03:29:24 +00:00
GitHub Actions
b3c0320e7e chore: bump Claude Code to 2.1.122 and Agent SDK to 0.2.122 v1.0.109 2026-04-28 22:05:53 +00:00
Octavian Guzu
c93e8fe879
docs: pull_request_target guidance and base-action trust model (#1250)
* docs: add pull_request_target/workflow_run guidance and base-action trust model

Adds a security.md section on safe checkout patterns under
pull_request_target/workflow_run, and a trust-model section to the
base-action README clarifying that callers are responsible for the
working directory and prompt being trusted.

🏠 Remote-Dev: homespace

* docs: refine PRT/workflow_run guidance — root checkout + workflow_run ref

Second example now checks out the base ref at the workspace root before
the head-ref subdirectory checkout (this action expects a git repo at
the root). Adds the workflow_run ref form, drops the PRT-specific
gh-pr-diff hint from the first example, and generalises the closing
line to cover both event types.

🏠 Remote-Dev: homespace

* docs: use actions/checkout@v6 in examples (consistency)

🏠 Remote-Dev: homespace
2026-04-28 10:01:48 -07:00
GitHub Actions
11a9dadd19 chore: bump Claude Code to 2.1.121 and Agent SDK to 0.2.121 v1.0.108 2026-04-28 00:31:46 +00:00
GitHub Actions
567fe954a4 chore: bump Claude Code to 2.1.119 and Agent SDK to 0.2.119 v1.0.107 2026-04-25 01:55:30 +00:00
GitHub Actions
2da6cfae68 chore: bump Claude Code to 2.1.120 and Agent SDK to 0.2.120 v1.0.106 2026-04-25 00:15:05 +00:00
GitHub Actions
e58dfa5555 chore: bump Claude Code to 2.1.119 and Agent SDK to 0.2.119 v1.0.105 2026-04-23 23:24:21 +00:00
Naoyoshi Aikawa
6ee201f023
fix: allow + in branch names (generated by Claude Code EnterWorktree) (#1248)
Claude Code's EnterWorktree tool converts "/" to "+" when generating
branch names from worktree names (e.g. EnterWorktree("feat/foo") creates
branch "worktree-feat+foo"). The strict whitelist in validateBranchName
rejected these names, causing claude-code-action to fail on any PR opened
from an EnterWorktree-generated branch.

Since all git calls use execFileSync (not shell interpolation), "+" carries
no command injection risk — the same rationale used for allowing "#".
Git itself permits "+" in branch names per git-check-ref-format.

Fixes: https://github.com/anthropics/claude-code-action/issues/1244

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:17:44 -07:00
GitHub Actions
b4d6741327 chore: bump Claude Code to 2.1.118 and Agent SDK to 0.2.118 v1.0.104 2026-04-23 00:42:34 +00:00
GitHub Actions
4e5d8b13ca chore: bump Claude Code to 2.1.117 and Agent SDK to 0.2.117 v1.0.103 2026-04-22 00:04:56 +00:00
GitHub Actions
5d5c10a4f3 chore: bump Claude Code to 2.1.116 and Agent SDK to 0.2.116 v1.0.102 2026-04-20 22:18:45 +00:00
Octavian Guzu
632a368e81
docs: nit updates to security.md (#1240)
🏠 Remote-Dev: homespace
2026-04-20 15:00:35 +01:00
Ashwin Bhat
4c682d8b65
chore: bump oven-sh/setup-bun to v2.2.0 (Node.js 24) (#1238)
setup-bun v2.1.2 runs on Node.js 20, which GitHub will stop supporting
on June 2, 2026. v2.2.0 updates the action runtime to Node.js 24.

Fixes #1237
2026-04-19 17:53:46 -07:00
GitHub Actions
38ec876110 chore: bump Claude Code to 2.1.114 and Agent SDK to 0.2.114 v1.0.101 2026-04-18 01:38:24 +00:00
Ashwin Bhat
0d2971c794
fix: pass install.sh binary path explicitly to Agent SDK (#1235)
Agent SDK 0.2.113 dropped vendor/ripgrep and now ships native binaries
via per-platform optionalDependencies. Two breakages:

- action.yml chmod'd vendor/ripgrep which no longer exists, failing the
  Install Dependencies step with find exit 1.
- The SDK auto-resolves its bundled binary by trying the -musl platform
  package before the glibc one. bun install does not respect the
  package.json libc field and installs both on glibc Linux, so the SDK
  picks the musl binary and spawn fails with ENOENT.

Remove the obsolete ripgrep chmod. Make installClaudeCode() return the
install.sh binary path and pass it explicitly as
pathToClaudeCodeExecutable so the SDK skips auto-resolution entirely.
v1.0.100
2026-04-17 15:50:46 -07:00
GitHub Actions
c68f82cb11 chore: bump Claude Code to 2.1.113 and Agent SDK to 0.2.113 2026-04-17 19:40:20 +00:00
Ashwin Bhat
78758edf84
chore: bump model version in workflows (#1227)
https://claude.ai/code/session_01Mc8dExn9NcARLohJ1XG5kv

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-16 15:25:28 -07:00
GitHub Actions
c3d45e8e94 chore: bump Claude Code to 2.1.112 and Agent SDK to 0.2.112 v1.0.99 2026-04-16 20:00:08 +00:00
GitHub Actions
931e620273 chore: bump Claude Code to 2.1.111 and Agent SDK to 0.2.111 v1.0.98 2026-04-16 15:22:22 +00:00
GitHub Actions
905d4eb99a chore: bump Claude Code to 2.1.110 and Agent SDK to 0.2.110 v1.0.97 2026-04-15 22:06:40 +00:00
GitHub Actions
5fb899572b chore: bump Claude Code to 2.1.109 and Agent SDK to 0.2.109 v1.0.96 2026-04-15 04:05:34 +00:00