Commit Graph
750 Commits
Author SHA1 Message Date
JuwanandGitHub 54eadc2f72 fix(security): unify secret redaction in public comment outputs (#1693)
Ensure all public issue, PR, and inline comments apply redactSecrets() in addition to sanitizeContent() before submitting payloads to the GitHub API. This aligns public comment output with error log and step-summary redaction policies, preventing potential leakage of Anthropic API keys, AWS credentials, Slack tokens, JWTs, and GitHub tokens.
2026-08-18 17:23:11 -07:00
GitHub Actions d40ddef4c0 chore: bump Claude Code to 2.1.235 and Agent SDK to 0.3.235 v1.0.195 2026-08-18 20:39:22 +00:00
GitHub Actions 459ad358ae chore: bump Claude Code to 2.1.234 and Agent SDK to 0.3.234 v1.0.194 2026-08-17 20:23:54 +00:00
Abhinav Kumar SinghandGitHub d721746d68 fix: bound image attachment downloads (#1625) 2026-08-14 16:47:46 -07:00
5da4c76dde fix: bump shell-quote to 1.8.4 to remediate CVE-2026-9277 (#1557)
shell-quote 1.8.3 (root and base-action dependency) is affected by
CVE-2026-9277, a CRITICAL severity vulnerability. 1.8.4 contains the fix.

Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
2026-08-14 16:46:34 -07:00
Ashwin BhatandGitHub a2cac87e27 ci: skip Claude-backed test jobs on fork PRs (#1655)
* ci: skip Claude-backed test jobs on fork PRs

Jobs that run the action against the Claude API authenticate via workload
identity federation, which fork PRs cannot mint an OIDC token for, so they
always failed on external contributions. Gate each such job on the PR head
repo matching the base repo; push and workflow_dispatch runs are unaffected.

No-Verification-Needed: CI workflow config only, exercised by Actions on the PR

* test: pin the bare remote's initial branch in fetch-depth test

The shallow-clone case created its bare remote with a plain git init, so
HEAD pointed at whatever init.defaultBranch resolves to (master on CI)
while the test only pushed main. git clone --depth=1 implies
--single-branch, and with a dangling remote HEAD it produces an empty,
non-shallow clone, so the is-shallow assertion failed on runners whose
default branch is not main.

No-Verification-Needed: test-only change
2026-08-14 16:40:34 -07:00
Rishav NaskarandGitHub b49813d0e7 feat(context): include diffHunk in PR review comment context (#1584)
* feat(context): include diffHunk in PR review comment context

Review comments arrived with only path and line, so the code they were
written against was missing from the prompt. Fetch diffHunk in the PR
GraphQL query and render it under the comment as a diff block.

The hunk is PR-authored content, so it goes through sanitizeContent like
the comment body. Comments without a hunk are unchanged.

Fixes #855

* test(formatter): cover outdated review comments with an empty diff hunk

GitHub returns diffHunk: "" (not null) for comments whose line no longer
exists in the diff, so the render guard has to reject empty strings too.
Found running the real query against anthropics/claude-code-action#1025.
2026-08-14 16:32:44 -07:00
9678fce999 fix(base-action): add ~/.local/bin to $GITHUB_PATH after auto-install (#1643)
## Problem

Signed-off-by: anish <anishesg@users.noreply.github.com>
Co-authored-by: anish <anishesg@users.noreply.github.com>
2026-08-14 16:31:36 -07:00
Madan kumarandGitHub ed186becce fix: only limit fetch depth when the checkout is already shallow (#1647)
restoreConfigFromBase and setupBranch pass --depth to every git fetch. On a
checkout made with fetch-depth: 0 that does not just cap the download: it
truncates the history already present and marks the repository shallow, which
drops the merge base with the base branch. `git log origin/<base>..HEAD` then
silently includes commits that are already merged, and
`git diff origin/<base>...HEAD` fails with "no merge base" — the two commands
the prompt tells Claude to run to scope its work to the PR.

Gate the flag on `git rev-parse --is-shallow-repository`, so a checkout that is
already shallow (the fetch-depth: 1 default) keeps the same depth behaviour and
the fetch savings it was added for, while a full checkout stays full.

Fixes #1642
2026-08-14 16:31:26 -07:00
05ee4b30d7 Harden delete_files MCP tool: validate paths within repo root (#1636)
Mirror the path validation already performed by the commit_files tool.
delete_files previously only normalized absolute paths against CWD and
passed relative paths through unchecked; it now runs each path through
validatePathWithinRepo, rejecting "../" traversal and symlinked escapes
for consistency and defense-in-depth.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-14 16:31:15 -07:00
GitHub Actions 9d7150bc8a chore: bump Claude Code to 2.1.233 and Agent SDK to 0.3.233 v1.0.193 2026-08-14 22:21:44 +00:00
GitHub Actions e63208cb98 chore: bump Claude Code to 2.1.232 and Agent SDK to 0.3.232 v1.0.192 2026-08-13 23:30:40 +00:00
GitHub Actions dc33e8a15b chore: bump Claude Code to 2.1.231 and Agent SDK to 0.3.231 2026-08-13 08:39:40 +00:00
GitHub Actions c58ad32088 chore: bump Claude Code to 2.1.229 and Agent SDK to 0.3.229 2026-08-12 20:57:42 +00:00
Henrique PiresandGitHub dfb8fc798e fix(mcp): detect binary files by content instead of extension allowlist (#1633) 2026-08-11 16:35:46 -07:00
a2489efcb9 fix(summary): keep every text block in structured tool results (#1619)
formatResultContent recognized structured tool output shaped like
`[{ type: "text", text: "..." }]` but read only `parsedContent[0].text`.
When a tool result split its output across several text blocks, the step
summary showed the first and silently dropped the rest, so extra findings,
file paths and follow-up instructions vanished from the rendered
Claude Code Report while remaining in the execution transcript.

Collect the text from every block instead of just the first. Blocks of other
types, such as images, are skipped rather than stringified into the summary.

Fixes #1572

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 16:35:38 -07:00
Abhinav Kumar SinghandGitHub 8b8745859f fix: paginate GitHub Actions MCP responses (#1629) 2026-08-11 16:35:34 -07:00
GitHub Actions 239e3a7308 chore: bump Claude Code to 2.1.228 and Agent SDK to 0.3.228 v1.0.191 2026-08-11 20:03:37 +00:00
GitHub Actions 5ef2e550a4 chore: bump Claude Code to 2.1.227 and Agent SDK to 0.3.227 v1.0.190 2026-08-10 23:16:28 +00:00
GitHub Actions 6b082c4193 chore: bump Claude Code to 2.1.226 and Agent SDK to 0.3.226 v1.0.189 2026-08-08 02:48:25 +00:00
GitHub Actions 7ff6806c8e chore: bump Claude Code to 2.1.225 and Agent SDK to 0.3.225 v1.0.188 2026-08-08 01:14:59 +00:00
NickNojiriandGitHub 751e003832 fix(branch): collapse empty path segments in branch_name_template (#1539)
A branch_name_template that places {{description}} (or another variable)
next to a slash crashes the run when the variable resolves to an empty
string. An issue/PR title with no ASCII-alphanumeric content — emoji-only,
CJK-only, or punctuation-only — makes extractDescription() return "", so a
template like "{{prefix}}{{description}}/{{entityNumber}}" produces
"claude//123". validateBranchName rejects consecutive (and leading/trailing)
slashes, and the thrown error propagates uncaught out of setupBranch,
aborting the entire run.

Normalize the templated result before the empty-result check: collapse runs
of slashes and drop any leading/trailing slash. Single-slash and dash
separators are untouched, so existing template behavior is unchanged; a
template that collapses to empty still falls back to the default format.

This is distinct from the {{label}} sanitization tracked in #1491 (and its
open PRs), which deliberately leave {{description}} alone — so this path
remained broken. Fixes the whole empty-segment class regardless of variable.

Adds regression tests for emoji-only and CJK-only titles, a trailing empty
segment, and a direct validateBranchName assertion proving the run no longer
aborts.
2026-08-07 07:59:52 -07:00
Rishav NaskarandGitHub b704dd3960 fix(branch): validate generated branch name under commit signing (#1582)
The non-signing path validated newBranch before checkout, but the
use_commit_signing path passed it straight to the file ops server, so an
invalid branch_name_template surfaced only as a 422 "Reference name is
not valid" on the first commit.

Validate once after the name is resolved so both paths fail early with
the same message.

Fixes #1573
2026-08-07 07:59:43 -07:00
Minh VuandGitHub ecf573bd65 fix: expose conclusion output (#1549) 2026-08-07 07:58:52 -07:00
Minh VuandGitHub 7764306e92 fix: stop retrying deterministic ref updates (#1551) 2026-08-07 07:58:19 -07:00
Minh VuandGitHub 5dd098c551 ci: pass allowed tools through claude args (#1552) 2026-08-07 07:57:29 -07:00
4c4309a064 fix(cache): disable setup-bun cache to avoid 5-retry HTML-error burn (#1580)
The upstream oven-sh/setup-bun action saves with a deterministic key
(Bun version) that isn't ref-aware. On every second-and-subsequent run
against the same PR ref, the GitHub cache API rejects the duplicate
key+ref with a 409 (HTML body), and @actions/cache treats the unparsable
response as transient and burns ~20-30s on 5 retries before warning.

The 35 MB Bun binary downloads in 2-3s, so disabling the cache is a net
wallclock win and removes the noisy warning that fires on every PR push
after the first.

Closes #1252

Co-authored-by: Mukunda Rao Katta <mukunda.vjcs6@gmail.com>
2026-08-07 07:57:18 -07:00
Minh VuandGitHub c4190dbd78 docs: update base action inputs (#1550) 2026-08-07 07:56:51 -07:00
Jeremy SchoemakerandGitHub 9a2db97708 docs: fix broken Bedrock anchor in cloud-providers.md (#1579)
The link pointed at `#for-aws-bedrock:`, which does not exist on the
github-actions docs page, so it landed readers at the top of a long page
instead of the Bedrock section.

The current heading id is `#using-with-amazon-bedrock-and-google-cloud`.
2026-08-07 07:56:43 -07:00
Sahil GuptaandGitHub 2df67d2c33 fix: match label_trigger case-insensitively (#1576)
label_trigger used a case-sensitive exact comparison, so a workflow
configured with label_trigger: "claude-task" did not fire when an issue
received a label named "Claude-Task" (the same label name with different
casing).

GitHub label names are unique without regard to case, so comparing without
case is unambiguous. It also matches the trigger_phrase check in the same
function, which is already case-insensitive.

Compare labelName and labelTrigger with toLowerCase(), and add a test
covering a mixed-case label.

Fixes #1571
2026-08-07 07:55:32 -07:00
Takaki SatoandGitHub d573b167d3 fix: support labeled action for pull_request events in track_progress (#1586)
Adds "labeled" to the valid pull_request actions for track_progress,
mirroring the existing support for issue events. Previously, adding
a label to a PR (e.g. to trigger a label-driven Claude review) would
fail validation even though the same pattern works for issues.

Fixes #1585
2026-08-07 07:55:20 -07:00
leepokaiandGitHub 0a5f191964 fix: handle null files field from GraphQL on very large PRs (#1593)
GitHub's GraphQL API returns files: null (with no errors entry, and
changedFiles misreported as 0) when a PR's diff is too large to compute.
The unguarded pullRequest.files.nodes dereference in the fetcher crashed
the action with 'TypeError: null is not an object', and the formatter had
the same latent crash on prData.files.nodes.length.

Widen the GitHubPullRequest type to files | null so the compiler enforces
guards, degrade gracefully in the fetcher with a warning, and render the
file count as unavailable (not '0 files') in the formatter.

Fixes #1587
2026-08-07 07:55:10 -07:00
ulofiaiandGitHub 6ef6450f51 fix: enforce max turns from claude args (#1607) 2026-08-07 07:55:06 -07:00
GitHub Actions 1623c36729 chore: bump Claude Code to 2.1.224 and Agent SDK to 0.3.224 v1.0.187 2026-08-07 04:02:00 +00:00
Ashwin BhatandGitHub 96e281f4d9 Run checkout auth cleanup when API commit signing is enabled (#1597)
* Run checkout auth cleanup when API commit signing is enabled

* Derive git-config test expectations from GITHUB_SERVER_URL

No-Verification-Needed: test-only change
2026-08-06 10:18:34 -07:00
Ashwin BhatandGitHub e1fc925862 Scope the config snapshot to files inside the working tree (#1596)
* Scope config snapshot to files inside the working tree

* Record excluded snapshot entries as placeholders instead of links

* Limit linked snapshot content to unmodified tracked files and tracked directories

File targets reached through a link are included only when their content is
unchanged from HEAD, and directory targets only when they contain tracked
files; anything else is recorded as a single placeholder. Adds tests for a
sensitive path that links to a tracked directory, links to untracked
directories, and links to tracked files modified after checkout.
2026-08-06 10:17:40 -07:00
Ashwin BhatandGitHub 0aee57ab82 Redact common credential patterns from published run output (#1595)
* Redact common credential patterns from published run output

* Handle color codes and escape sequences ahead of redacted values

Vendor-prefixed formats no longer require a leading word boundary, so a
value that follows an ANSI SGR terminator or a serialized JSON escape is
still matched. AWS key ids keep a boundary but also accept those cases.
sanitizeContent goes back to GitHub-only redaction for inbound content,
and the failure annotation is redacted like the tracking comment.

* Coerce non-string text content before redacting tool results

No-Verification-Needed: one-line coercion in a formatting helper plus regression test
2026-08-06 10:17:25 -07:00
GitHub Actions c038e4dcde chore: bump Claude Code to 2.1.223 and Agent SDK to 0.3.223 v1.0.186 2026-08-06 00:53:11 +00:00
Ashwin BhatandGitHub 4c04887769 Invoke the formatter directly from the format hook (#1594)
* Invoke the formatter directly from the format hook

The PostToolUse format hook now runs prettier directly with a pinned
version and --no-config instead of going through the package.json
"format" script, so the hook resolves the same way regardless of the
scripts and formatter config in the checked-out tree. Output matches
the previous "bun run format" (both .prettierrc files are empty).

Also documents which paths the action restores from the PR base branch
and recommends keeping base-branch hooks self-contained.

No-Verification-Needed: config, comment, and doc-only change

* Qualify the self-contained hook guidance for Bun-only runners

Note in docs/security.md and the restore-config JSDoc that bunx runs the
tool under node when node is on PATH, but on a Bun-only runner Bun runs
the script itself and reads bunfig.toml (preload etc.) from the
checkout, so that file and .npmrc are runtime config from the PR head.

No-Verification-Needed: comment- and doc-only change

* Exclude .claude-pr from prettier

No-Verification-Needed: prettierignore-only change
2026-08-05 15:38:47 -07:00
GitHub Actions 9db594c7a0 chore: bump Claude Code to 2.1.222 and Agent SDK to 0.3.222 v1.0.185 2026-08-04 22:40:25 +00:00
Ashwin BhatandGitHub acb0385805 Check collaborator permissions for workflow_run events (#1590)
The write-permission gate previously only ran for issue/PR entity
events. Apply it to workflow_run events as well, checking both the
workflow actor and the actor recorded on the upstream run when they
differ. allowed_non_write_users and the github_token override behave
the same as for entity events. Document the behavior for workflow_run
pipelines.
2026-08-04 10:05:34 -07:00
Ashwin BhatandGitHub b80a0f042f Match downloaded images to their source URLs by asset identifier (#1588)
* Match downloaded images to source URLs by asset identifier

* Derive the signed URL asset identifier from the parsed path
2026-08-04 10:04:47 -07:00
Ashwin BhatandGitHub 6fb6bb6858 Pin bun config for MCP server processes (#1589) 2026-08-04 10:03:43 -07:00
Ashwin BhatandGitHub b2963b9127 Derive trigger timestamps for issues and pull_request events (#1592)
* Derive trigger timestamps for issues and pull_request events

For issues labeled/assigned triggers, look up the matching event in the
issue's event history to get the exact time of the label/assignment,
falling back to the payload's updated_at/created_at when the lookup
fails. issues opened uses issue.created_at; pull_request opened uses
pull_request.created_at and other pull_request actions use updated_at.

* Ignore issue label/assign events older than the payload snapshot

A matching labeled/assigned event that predates the webhook payload's
issue.updated_at cannot be the event that fired the webhook, so fall
back to the payload timestamps instead of adopting it as the boundary.
2026-08-03 19:15:50 -07:00
GitHub Actions 86180fa9e4 chore: bump Claude Code to 2.1.221 and Agent SDK to 0.3.221 v1.0.184 2026-08-04 00:15:10 +00:00
GitHub Actions be7b93b190 chore: bump Claude Code to 2.1.220 and Agent SDK to 0.3.220 v1.0.183 2026-07-25 01:36:28 +00:00
GitHub Actions e0cf66d1d2 chore: bump Claude Code to 2.1.219 and Agent SDK to 0.3.219 v1.0.182 2026-07-24 17:14:37 +00:00
GitHub Actions 44423bdec7 chore: bump Claude Code to 2.1.218 and Agent SDK to 0.3.218 v1.0.181 2026-07-22 21:27:29 +00:00
KeisukeYamashitaandGitHub b00a3414fd fix: share one exchanged WIF credential across spawned Claude processes (#1407)
* fix: share one exchanged WIF credential across spawned Claude processes

GitHub OIDC tokens are single-use at the Anthropic token-exchange
endpoint (the same jti cannot be exchanged twice). With plugins
configured, the action spawns several short-lived claude processes
(plugin marketplace add, one plugin install per plugin, then the main
query). Each resolved federation from bare env vars and exchanged the
same identity-token file independently: the first exchange succeeded
and every later process got 401 (jti_reused), which the main query
retried for ~3 minutes before failing the job.

The SDK only enables its on-disk credentials cache when federation is
loaded from a profile config file, not from bare env vars. Write a
profile pointing at the identity-token file and select it via
ANTHROPIC_CONFIG_DIR / ANTHROPIC_PROFILE so the first process exchanges
once and the rest reuse the cached access token. The env vars are kept
as a fallback for CLIs that predate profile support.

* fix: scope the WIF credential cache per federation config

Address review feedback on the shared-credentials-cache fix:

- Embed a fingerprint of the federation inputs (rule, org, service
  account, workspace, base URL, scope) in the config dir name. The SDK
  cache reuses a token on expires_at alone and RUNNER_TEMP is per-job,
  so a later step with different federation inputs would silently reuse
  the first step's token. service_account_id and scope are included
  beyond the reviewed list because both are sent in the exchange
  request body and change which credential is minted.
- Skip the action-managed profile with a warning when the operator has
  already set ANTHROPIC_CONFIG_DIR or ANTHROPIC_PROFILE.
- Shrink the profile to the minimal file-backed form; the CLI's bundled
  SDK gap-fills the federation fields from the env vars the action
  already exports (verified against the pinned 2.1.173 binary).
- Remove the token dir in stop() so the identity token and the cached
  exchanged credential don't outlive the step.
- Document that cache sharing relies on the plugin subprocesses
  spawning sequentially.
2026-07-22 07:02:41 -07:00
GitHub Actions fa7e2f0a29 chore: bump Claude Code to 2.1.217 and Agent SDK to 0.3.217 v1.0.180 2026-07-21 21:35:48 +00:00