Commit Graph
759 Commits
Author SHA1 Message Date
f3f2789f0a fix(mcp): recognize mcp__github aggregate selector for GitHub MCP server initialization (#1657)
* fix(mcp): accept shorthand selectors for GitHub MCP server initialization

## Problem

Signed-off-by: anish <anishesg@users.noreply.github.com>

* address review feedback: fix prettier formatting

Signed-off-by: anish <anishesg@users.noreply.github.com>

---------

Signed-off-by: anish <anishesg@users.noreply.github.com>
Co-authored-by: anish <anishesg@users.noreply.github.com>
2026-08-20 16:17:25 -07:00
Gautam SharmaandGitHub 6a5f1d8e0a fix(cleanup): keep the base-branch config revert out of the auto-commit (#1677)
restoreConfigFromBase replaces .claude/, CLAUDE.md and the other sensitive
paths with the PR base branch's versions, then deliberately unstages them so
the revert does not reach a commit. checkAndCommitOrDeleteBranch then ran a
bare `git add -A`, which staged them again and pushed a silent revert of the
PR author's own config onto their branch, under a commit message that says
only "Auto-commit: Save uncommitted changes from Claude".

restoreConfigFromBase now returns the paths it restored. run.ts threads them
through updateCommentLink into checkAndCommitOrDeleteBranch, which excludes
them via pathspec from both the staging and the git status check.

The exclusion is driven by what was actually restored rather than applied
unconditionally. This path also runs for issues, where no restore happens and
Claude may legitimately have been asked to edit CLAUDE.md or
.claude/settings.json; excluding those there would silently drop the work —
trading one silent-data-loss bug for another. Reverting the fix, dropping the
status scoping, and switching to an unconditional exclusion each fail the new
tests.

The status check is scoped the same way as the staging: when the reverted
config is the only dirty entry there is no real work, so the branch is now
correctly treated as empty and deleted instead of receiving a pure revert.

Reachable on a closed or merged PR where Claude left uncommitted changes with
use_commit_signing false — the only combination where a restore has run and
claudeBranch is set.

Fixes #1669
2026-08-20 16:17:03 -07:00
HyunSooandGitHub 39ad3c8977 fix(github): honor GITHUB_GRAPHQL_URL for the GraphQL client (#1575)
The REST client honors GITHUB_API_URL, but the GraphQL client derived its
base URL from GITHUB_API_URL as well and ignored the standard
GITHUB_GRAPHQL_URL variable that GitHub Actions provides. On standard GitHub
Enterprise Server this still worked because @octokit/graphql rewrites a
".../api/v3" REST base to ".../api/graphql", but any deployment whose GraphQL
endpoint is not derivable from the REST base (custom proxy, separate host)
sent GraphQL requests to the wrong URL.

Honor GITHUB_GRAPHQL_URL independently and fall back to GITHUB_API_URL when it
is unset, so behavior is unchanged for github.com and standard GHES. A single
trailing "/graphql" is stripped because @octokit/graphql appends its own.

Add wire-level regression tests that run the real client factory in a fresh
process and assert the final request URLs and Authorization headers;
constructor-option assertions are insufficient because @octokit/graphql
rewrites the path after the client is constructed.
2026-08-20 15:45:21 -07:00
GitHub Actions 3f854a8fb5 chore: bump Claude Code to 2.1.238 and Agent SDK to 0.3.238 v1.0.198 v1 2026-08-20 20:33:55 +00:00
GitHub Actions 5ee796a55f chore: bump Claude Code to 2.1.237 and Agent SDK to 0.3.237 v1.0.197 2026-08-20 00:54:23 +00:00
Tem RevilandGitHub cff8d3c8f0 fix(git-config): neutralize checkout credential in include-based config (#1526)
configureGitAuth() removed the actions/checkout auth header with
`git config --unset-all http.<server>/.extraheader`, which only edits the
repo-local config. Since actions/checkout v6.0.0 (backported to v5.0.1 and
v4.3.1) the header is written to a separate file under RUNNER_TEMP and
pulled in via include.path, so --unset-all on the local config is a no-op:
the code logged "No existing authentication headers to remove" while the
checkout credential (usually the workflow GITHUB_TOKEN) stayed usable by
git for the rest of the job.

Also clear the header from every included file, so it is neutralized under
both the pre-v6 (local) and v6+ (include) layouts. Includes that do not
define the header are left untouched.

Fixes #1510
2026-08-19 17:23:23 -07:00
GitHub Actions e2a4b761cd chore: bump Claude Code to 2.1.236 and Agent SDK to 0.3.236 v1.0.196 2026-08-19 20:05:23 +00:00
65b50df083 fix(github): match bot actors in comment filters using GraphQL __typename (#1616)
`exclude_comments_by_actor` and `include_comments_by_actor` never matched
any bot. Both the documented `*[bot]` wildcard and exact entries such as
`dependabot[bot]` silently did nothing.

GitHub's GraphQL API returns the bare login for App actors ("dependabot"),
while REST and the GitHub UI append a suffix ("dependabot[bot]"). Filter
patterns are written in the suffixed form, so matching a GraphQL login
against them could never succeed and `actor.endsWith("[bot]")` was dead
code.

Request `__typename` on the Actor-typed author selections and normalize
App actors to their suffixed name via `resolveActorName()` before matching.
Normalizing at the filter boundary fixes the wildcard and exact-match cases
together, and leaves the author names shown in the prompt unchanged.

The existing test mocked `login: "scanner[bot]"`, a payload GraphQL never
produces, which is why the gap was invisible. It now mocks the real shape
(`__typename: "Bot", login: "scanner"`) and fails without this fix.

The commit author selection is left alone: it is a GitCommit, not an Actor.

Fixes #1514

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 17:24:26 -07:00
JuwanandGitHub 0a80d21df7 fix: strip unused ALL_INPUTS environment variable from Claude subprocess env (#1692) 2026-08-18 17:23:38 -07:00
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