668 Commits

Author SHA1 Message Date
GitHub Actions
01872ccc02 chore: bump Claude Code to 2.1.200 and Agent SDK to 0.3.200 v1.0.164 2026-07-03 16:53:31 +00:00
GitHub Actions
769e3bdff9 chore: bump Claude Code to 2.1.199 and Agent SDK to 0.3.199 v1.0.163 2026-07-02 23:36:20 +00:00
GitHub Actions
6c0083bb72 chore: bump Claude Code to 2.1.198 and Agent SDK to 0.3.198 v1.0.162 2026-07-01 20:46:29 +00:00
kashyap murali
846d5d8993
Add agent-approval-check composite action (#1429)
* Add agent-approval-check composite action

Require N human approvals on PRs that contain agent-authored commits.
Posts an agent-approval-check commit status that repos mark as a
required check on protected branches.

This is a sanitized port of the check Anthropic runs internally on
every agent-authored PR — same detection rules, /approve <sha>
comment flow, sibling-PR-same-SHA guard, and fail-closed semantics,
with the Anthropic-specific path exemptions and kill-switch removed
and config moved to action inputs.

Co-Authored-By: Claude <noreply@anthropic.com>

* Drop stray internal acronym from comment

* agent-approval-check: require write-access approvers, pin deps, pagination + doc fixes

🏠 Remote-Dev: homespace

* agent-approval-check: prettier

🏠 Remote-Dev: homespace

* agent-approval-check: verify approver write permission via REST; commits(last:100); docstring

🏠 Remote-Dev: homespace

* agent-approval-check: use headRefOid; drop pull_request_review trigger and correct threat-model docs

🏠 Remote-Dev: homespace

* agent-approval-check: stale-notification wording, no-retry-on-4xx, docstring API-call count

🏠 Remote-Dev: homespace

* agent-approval-check: fail-closed sibling guard on commits-ordering edge; drop stale 'reviewed' from README

🏠 Remote-Dev: homespace

* agent-approval-check: drop hardcoded API-call counts from logs; clarify author write-access requirement in README

🏠 Remote-Dev: homespace

* agent-approval-check: count all agent-email commits (close-reopen bypass); validate REQUIRED_APPROVALS>=1; exempt_head_branches warning

🏠 Remote-Dev: homespace

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Octavian Guzu <oct@anthropic.com>
2026-06-30 14:09:57 -07:00
GitHub Actions
fad22eb3fa chore: bump Claude Code to 2.1.197 and Agent SDK to 0.3.197 v1.0.161 2026-06-30 17:57:23 +00:00
GitHub Actions
4633baf526 chore: bump Claude Code to 2.1.196 and Agent SDK to 0.3.196 v1.0.160 2026-06-29 23:27:52 +00:00
GitHub Actions
a92e7c70a4 chore: bump Claude Code to 2.1.195 and Agent SDK to 0.3.195 v1.0.159 2026-06-26 21:30:09 +00:00
tarunag10
f8076dc008
fix: bound app token revocation cleanup (#1437) 2026-06-25 20:57:44 -07:00
GitHub Actions
5211368122 chore: bump Claude Code to 2.1.193 and Agent SDK to 0.3.193 v1.0.158 2026-06-25 21:46:38 +00:00
GitHub Actions
428971d2ec chore: bump Claude Code to 2.1.191 and Agent SDK to 0.3.191 v1.0.157 2026-06-24 21:59:09 +00:00
GitHub Actions
74eedf1a18 chore: bump Claude Code to 2.1.190 and Agent SDK to 0.3.190 v1.0.156 2026-06-24 15:55:36 +00:00
GitHub Actions
80b3182633 chore: bump Claude Code to 2.1.187 and Agent SDK to 0.3.187 v1.0.155 2026-06-23 21:05:06 +00:00
Bellal Mohamed
360be9c8fc
fix: allow @ in branch names (valid per git-check-ref-format) (#1411)
`validateBranchName` rejects branch names containing `@`, even though
`git check-ref-format` permits `@` and GitHub itself accepts such
branches. PRs whose head or base branch contains an `@` fail validation
in-process before any git operation, so the action errors out
immediately.

Branch names with `@` show up in real workflows: ticket conventions
like "TICKET-123@add-feature" (#998), leading-prefix conventions like
"@hotfix/...", and agent tooling that appends "@<sessionid>" (#1305).
There is no workaround other than renaming the branch, which is often
not under the user's control.

Branch names are never passed through a shell (git calls use
execFileSync argv arrays), so `@` carries no injection risk. This is
the same reasoning used to add `#` in #1167, `+` in #1248, and `,` in
#1310. The bare name "@" (HEAD shorthand in git revision syntax) and
the "@{" reflog sequence are still rejected.

- Add `@` to the validateBranchName whitelist regex, including the
  leading position (the leading-character rule blocks option injection
  via `-`, which `@` cannot cause)
- Reject the bare name "@" with a dedicated check
- Update the surrounding comment, JSDoc, and error message to match
- Add test cases for @-containing names and bare "@"

Fixes #998

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-22 14:42:36 -07:00
farmer
e452eb9dce
test: cover format-turns content-type fallbacks and system_other handling (#1421)
Adds unit tests for previously-uncovered branches in
src/entrypoints/format-turns.ts:

- detectContentType: malformed-JSON fall-through (objects and arrays)
  and the default python classification for non-python/non-js code
- formatResultContent: non-string inputs (number, plain object)
- groupTurnsNaturally / formatGroupedContent: the system_other path
  for non-init system turns

Tests only; no source changes. format-turns.ts line coverage rises
from ~86% and the file's non-CLI logic is now fully exercised.

Co-authored-by: hk <solanamobilech@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 14:41:41 -07:00
Steven Zimmerman, CPA
6b8063043e
fix: filter PR reviews and inline review comments to trigger time (#1385)
Issue/PR comments (#512) and the issue/PR body (#710) are filtered to the
trigger timestamp so content created or edited after an authorized trigger
cannot be injected into Claude's prompt (TOCTOU protection). Reviews and
inline review comments were not: fetchGitHubData returned reviewData filtered
by actor only, and formatReviewComments renders it into the prompt, so a
review submitted or edited after the trigger reached Claude verbatim.

filterReviewsToTriggerTime already existed (added alongside the comment filter
in #512) but was only wired to the image-download list, never to the returned
reviewData.

Filter reviewData.nodes through filterReviewsToTriggerTime and each review's
inline comments through filterCommentsToTriggerTime, alongside the existing
actor filter, then build the review image-processing lists from those
already-filtered nodes (removing a now-redundant second filter pass).
Strengthen the two integration tests to assert post-trigger and edited-after
reviews/comments are dropped.
2026-06-22 14:41:33 -07:00
GitHub Actions
30544b6743 chore: bump Claude Code to 2.1.186 and Agent SDK to 0.3.186 v1.0.154 2026-06-22 20:38:23 +00:00
GitHub Actions
2fee155104 chore: bump Claude Code to 2.1.185 and Agent SDK to 0.3.185 v1.0.153 2026-06-20 21:00:13 +00:00
GitHub Actions
51705da45e chore: bump Claude Code to 2.1.183 and Agent SDK to 0.3.183 v1.0.152 2026-06-19 01:21:31 +00:00
GitHub Actions
806af32823 chore: bump Claude Code to 2.1.181 and Agent SDK to 0.3.181 v1.0.151 2026-06-17 22:08:47 +00:00
Ryan Noonan
0a08a86780
fix: skip workflow validation token exchange failures (#1417) 2026-06-17 13:53:35 -07:00
GitHub Actions
9dd8b95a39 chore: bump Claude Code to 2.1.179 and Agent SDK to 0.3.179 v1.0.150 2026-06-16 20:23:28 +00:00
GitHub Actions
4d7e1f0cd8 chore: bump Claude Code to 2.1.178 and Agent SDK to 0.3.178 v1.0.149 2026-06-15 21:37:45 +00:00
bymle
3d9f0dc7dc
fix(mcp): align allowed-tools parser with SDK option parser (#1373)
parseAllowedTools (used to decide which GitHub MCP servers to install)
hand-rolled a regex parse of claude_args, while the tools actually
granted to Claude are parsed by parseClaudeArgsToExtraArgs in
base-action/src/parse-sdk-options.ts using shell-quote. The two parsers
diverged on two inputs (#1357):

- Multiple values after a single flag: for
  `--allowedTools "Read" "Grep" "mcp__github__get_commit"` the regex
  captured only "Read", so the github MCP server was not installed even
  though mcp__github__get_commit was granted — tool calls then failed.
- Commented-out lines: the regex counted tools on `#`-prefixed lines
  that the SDK parser strips, installing servers that were never used.

Reimplement parseAllowedTools on the same shell-quote tokenizer and the
same "accumulating flag consumes all consecutive non-flag values"
semantics, stripping comment lines first, so the install decision agrees
with the tools that are actually granted. Unquoted glob patterns (e.g.
`mcp__github__*`), which shell-quote yields as glob objects, are
recovered to their literal text to preserve existing behavior.

Closes #1357

Co-authored-by: bymle <229636660+bymle@users.noreply.github.com>
2026-06-13 22:49:34 -07:00
alexglynn
a5e5d3b82e
fix(parse-sdk-options): prevent shell-quote from collapsing unquoted Bash(X:*) rules to bare Bash (#1350)
* fix(parse-sdk-options): prevent shell-quote from collapsing unquoted Bash(X:*) rules to bare Bash

shell-quote's parse() tokenizes unquoted `(`, `)` as control operators
and barewords containing `*` as glob ops, all returned as non-string
objects. parseClaudeArgsToExtraArgs filtered those out, so an unquoted
`--allowedTools View,Bash(gh:*),Bash(cat:*)` collapsed to bare `Bash` —
silently widening scoped permission rules to unrestricted Bash(*).

Escape shell control metachars to Unicode private-use placeholders
before parse() and restore after; extract .pattern from glob ops.
Preserves existing quote/whitespace handling.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci: retrigger

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-13 22:45:14 -07:00
GitHub Actions
d5726de019 chore: bump Claude Code to 2.1.177 and Agent SDK to 0.3.177 v1.0.148 2026-06-13 01:25:48 +00:00
GitHub Actions
56fa348258 chore: bump Claude Code to 2.1.176 and Agent SDK to 0.3.176 v1.0.147 2026-06-12 21:54:44 +00:00
Ashwin Bhat
82d95d45af
Add pr-stamp-sweep review workflow (#1409)
* Add pr-stamp-sweep review workflow

Adds a reusable workflow script that fans out one reviewer agent per
candidate PR to judge whether it can be approved as-is, then runs an
adversarial verification pass on each approval recommendation before
including it in the final list.

Reviewers read pre-fetched PR dossiers from /tmp/claude/pr-sweep/<n>.md
(metadata, body, comments, full diff) rather than calling gh directly,
and verify diff claims against the local checkout. PR numbers are
passed via args; the script fails fast if none are provided.

* Sharpen security checklist in reviewer prompts

Replace the general security-history note with explicit attack classes
both reviewer stages must check: prompt injection (untrusted content
reaching Claude's context, including via tool output), code execution
(shell commands, eval/spawn, workflow expressions), path traversal,
and credential exposure.
2026-06-11 21:54:48 -07:00
GitHub Actions
0cb4f3e5e7 chore: bump Claude Code to 2.1.175 and Agent SDK to 0.3.175 v1.0.146 2026-06-12 04:24:54 +00:00
0xyjkim
8551f4b0aa
fix(image-downloader): detect image type from magic bytes (#1396)
GitHub serves pasted attachments from /user-attachments/assets/<uuid>
with no file extension, so getImageExtension() silently defaulted to
".png". When the bytes are actually JPEG/GIF/WebP the downloaded file is
mislabeled, and the Read tool then sends a base64 image whose declared
media_type doesn't match its magic bytes — which the Anthropic API
rejects with `400 invalid_request_error` ("image was specified using the
image/png media type, but the image appears to be a image/jpeg image").

Sniff the real format from the buffer's magic bytes after download and
only fall back to the URL-based extension when the signature is
unrecognized. Adds a regression test for a JPEG at an extensionless URL.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 21:23:35 -07:00
looooown
eba921ff6f
docs: fix execution file parsing example (#1297) 2026-06-11 21:19:57 -07:00
bymle
36617bd48b
fix(sanitizer): match attribute quotes by type to avoid mangling content (#1371)
stripHiddenAttributes used the pattern `["'][^"']*["']` for each quoted
attribute, which matches an opening quote of either type and stops at the
first quote of either type. When a value contained the other quote
character — e.g. an apostrophe inside a double-quoted attribute like
`title="We'll do it"` — the match terminated at the apostrophe, so the
wrong span was removed and the surrounding text was corrupted (e.g.
`<Tooltip title="We'll do it" placement="top">` became
`<Tooltipll do it" placement="top">`).

This surfaced via the github_inline_comment MCP tool: suggestion blocks
whose code lines contain quotes were mangled before posting (#1366).

Match each quoted form per quote type (`"[^"]*"` and `'[^']*'`),
mirroring stripMarkdownLinkTitles, so a value may freely contain the
other quote character. The unquoted fallback is unchanged.

Closes #1366

Co-authored-by: bymle <229636660+bymle@users.noreply.github.com>
2026-06-11 21:19:44 -07:00
joshpayne-joby
24b915648e
Include labels in formatContext() output for issues and PRs (#1298)
The formatted_context block sent to the agent omitted labels for both
issues and pull requests, even though the GraphQL queries already
fetched them. This caused agents to incorrectly report "no labels"
when labels existed, breaking any workflow that routes on label state
(e.g., drift-fix routing on drift:* labels in a Drift Watcher pattern).

Changes:
- Add 'PR Labels:' line to PR context output
- Add 'Issue Labels:' line to issue context output
- Both emit 'none' when no labels are present (explicit > omitted)
- Bump labels(first: 1) → labels(first: 100) in both queries; the
  previous cap meant only one label would appear even after the
  formatter fix
- Update existing tests + add 'with labels' tests for both PR and
  issue branches

Discovered while building a GitHub Actions workflow that uses this
action for drift-watcher routing in an internal seed framework
(joshpayne-joby/slim-routines#6). The agent self-diagnosed the gap
by inspecting this action's source — a satisfying full-loop.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-11 21:19:15 -07:00
Kyungil Park
9441a7fe22
fix: clear stale claude-prompts dir before each write (#1288)
Previously, prompt files at `${RUNNER_TEMP}/claude-prompts/` from a prior
invocation could persist on non-ephemeral self-hosted runners (where the
documented `RUNNER_TEMP` cleanup contract is not reliably honored). In
particular, `claude-user-request.txt` is only written by `create-prompt`
when a user request exists; an `agent`-mode invocation does not overwrite
it, so a stale value left by an earlier mention-mode job in another repo
would leak into a later agent-mode job's effective context on the same
runner agent.

Fix: `rm -rf` the directory before `mkdir` in both write sites
(`src/create-prompt/index.ts`, `src/modes/agent/index.ts`). Idempotent,
safe on hosted runners (where the dir is already empty), and self-heals
on self-hosted runners.

Closes #1287
2026-06-11 21:18:57 -07:00
Kiwi
b371255139
pin setup-bun path for post steps (#1365)
Signed-off-by: kiwigitops <kiwisclubco@gmail.com>
2026-06-11 21:18:24 -07:00
Stephen Cobbe
84d317e8f9
fix: break SDK iterator after result message to prevent hang (#1339)
In some workflow contexts — reliably reproducible for us on
pull_request-triggered runs of this action — the Claude Agent SDK
query() async iterator does not close after the terminal result
message is emitted. The for-await loop in runClaudeWithSdk blocks
indefinitely after Claude has finished its work, until the workflow's
timeout-minutes cap kills the job.

Symptoms observed in production (4× in our scan-reviewer workflow):
- Claude completes successfully: SDK emits { type: "result",
  subtype: "success", ... } with the cost / turns / duration set.
- The action then sits with zero log output for the rest of
  timeout-minutes (we measured 18-19 min of dead time after result).
- The job is cancelled at timeout. writeExecutionFile is never
  called → no claude-execution-output.json → cost-tracker and other
  post-steps see nothing.
- Run shows as cancelled, even though Claude did its work and any
  verdict it posted via gh tools already landed.

Author-mode (workflow_dispatch) runs from the same codebase
terminate cleanly the same day, so the hang is specific to certain
event triggers.

By SDK contract the result message is terminal — no further messages
follow. Break out of the loop immediately after capturing it,
regardless of whether the upstream iterator ever closes. If the SDK
is later fixed to close cleanly in all contexts, this break becomes
a no-op.
2026-06-11 21:17:47 -07:00
Nikita Kirsanov
cd59d5df0d
fix: fall back to inherited env for auth when inputs are empty (#1342)
The "Run Claude Code Action" step maps the auth inputs into env
unconditionally:

    ANTHROPIC_API_KEY: ${{ inputs.anthropic_api_key }}
    CLAUDE_CODE_OAUTH_TOKEN: ${{ inputs.claude_code_oauth_token }}

When the input is empty — whether because the caller supplied auth via
the step `env:` block (as reported in #676) or because the `with:` value
resolves empty in some runner/secret configurations — this assignment
overwrites the inherited env value with an empty string. validate-env
then fails with the misleading "Either ANTHROPIC_API_KEY or
CLAUDE_CODE_OAUTH_TOKEN is required" error even though the caller did
provide a token.

Fall back to the inherited env var when the input is empty, mirroring the
existing `${{ env.X }}` pattern already used a few lines below for
ANTHROPIC_BASE_URL / ANTHROPIC_CUSTOM_HEADERS. The input still takes
precedence; nothing changes for workflows that pass auth via `with:`.

Fixes #676
2026-06-11 21:17:22 -07:00
bymle
8046d850b5
docs(faq): correct rebase FAQ to match actual behavior (#1370)
The "Why won't Claude rebase my branch?" FAQ told users they could
enable rebasing by passing `--allowedTools "Bash(git rebase:*)"` via
claude_args. This does not work: the system prompt built in
src/create-prompt/index.ts unconditionally instructs Claude that it
cannot merge, rebase, or perform branch operations beyond creating and
pushing commits, so Claude declines rebase requests regardless of the
allowed tools.

Update the FAQ to describe the actual behavior and point users to the
real workaround (rebase locally or via the Claude Code CLI).

Closes #1286

Co-authored-by: bymle <229636660+bymle@users.noreply.github.com>
2026-06-11 21:16:55 -07:00
MateusSilva
ee2b19d882
test: add unit tests for parseGitHubContext and context type guards (#1404)
* test: add unit tests for parseGitHubContext and context type guards

Covers all supported webhook event types (entity and automation),
the pull_request_target normalization, isPR detection for comments
on pull requests, env-derived input defaults and parsing, and the
nine type guard functions. Raises src/github/context.ts line
coverage from 26.5% to 100%.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: assert all env-derived inputs to close mutation testing gaps

Mutation testing (StrykerJS, 138 mutants) showed 22 surviving mutants
in the env input parsing of parseGitHubContext: fields like
trackProgress, includeFixLinks, allowedBots and the comment actor
filters were never asserted. Asserting every input field in both the
defaults and the explicit-values tests, plus covering the optional
chaining on payload.repository, brings the mutation score for
src/github/context.ts from 84.06% to 100%.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:16:45 -07:00
GitHub Actions
ebcdfe6dc6 chore: bump Claude Code to 2.1.174 and Agent SDK to 0.3.174 v1.0.145 2026-06-12 01:17:25 +00:00
GitHub Actions
0f97b95b65 chore: bump Claude Code to 2.1.173 and Agent SDK to 0.3.173 v1.0.144 2026-06-11 05:43:00 +00:00
GitHub Actions
eee73e2ae5 chore: bump Claude Code to 2.1.172 and Agent SDK to 0.3.172 v1.0.143 2026-06-10 21:01:40 +00:00
Chase McCoy
232c9a15f4
Drop --tsconfig-override from Bun invocations to avoid runtime crash (#1315)
* Drop --tsconfig-override from Bun invocations to avoid runtime crash

Passing --tsconfig-override to `bun run` triggers a Bun runtime bug
("Internal error: directory mismatch for directory .../tsconfig.json")
that aborts the action with exit code 1 before any work is done.

Bun already auto-discovers the action's own tsconfig.json by walking up
the directory tree from the entry file, so the override is redundant —
the workspace's tsconfig is never an ancestor of the action checkout.
Dropping the flag preserves tsconfig resolution while avoiding the crash.

Refs: oven-sh/bun#25730

https://claude.ai/code/session_01L763e4S7zBnzDqmYYEJS1A

* Fix prettier formatting in create-prompt/index.ts

Removes redundant outer parentheses that were tripping format:check.
Pre-existing on main; unrelated to the action.yml change but needed
to keep CI green on this branch.

https://claude.ai/code/session_01L763e4S7zBnzDqmYYEJS1A

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-09 14:12:16 -07:00
GitHub Actions
11ba60486e chore: bump Claude Code to 2.1.170 and Agent SDK to 0.3.170 v1.0.142 2026-06-09 17:27:26 +00:00
GitHub Actions
593d7a5c4e chore: bump Claude Code to 2.1.169 and Agent SDK to 0.3.169 v1.0.141 2026-06-08 21:57:59 +00:00
GitHub Actions
fbda2eb1bd chore: bump Claude Code to 2.1.168 and Agent SDK to 0.3.168 v1.0.140 2026-06-06 23:42:46 +00:00
GitHub Actions
64de744025 chore: bump Claude Code to 2.1.167 and Agent SDK to 0.3.167 v1.0.139 2026-06-06 01:34:14 +00:00
GitHub Actions
410165836e chore: bump Claude Code to 2.1.166 and Agent SDK to 0.3.166 v1.0.138 2026-06-06 00:56:12 +00:00
GitHub Actions
41ea7642c1 chore: bump Claude Code to 2.1.165 and Agent SDK to 0.3.165 v1.0.137 2026-06-05 05:45:57 +00:00
GitHub Actions
0b1b620029 chore: bump Claude Code to 2.1.163 and Agent SDK to 0.3.163 v1.0.136 2026-06-04 21:54:01 +00:00
GitHub Actions
70a6e5256e chore: bump Claude Code to 2.1.162 and Agent SDK to 0.3.162 v1.0.135 2026-06-03 21:32:44 +00:00