Commit Graph
730 Commits
Author SHA1 Message Date
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
GitHub Actions b76a0776ae chore: bump Claude Code to 2.1.216 and Agent SDK to 0.3.216 v1.0.179 2026-07-20 22:14:27 +00:00
GitHub Actions af0559ee4f chore: bump Claude Code to 2.1.215 and Agent SDK to 0.3.215 v1.0.178 2026-07-19 02:56:28 +00:00
GitHub Actions 3553f84341 chore: bump Claude Code to 2.1.214 and Agent SDK to 0.3.214 v1.0.177 2026-07-18 01:20:51 +00:00
GitHub Actions 700e7f8316 chore: bump Claude Code to 2.1.212 and Agent SDK to 0.3.212 v1.0.176 2026-07-17 00:27:04 +00:00
PaarthandGitHub 3e807ec379 fix: handle null comment/review author from deleted accounts (#1490)
GitHub's GraphQL author field is null when the account behind a
comment, review, PR, or issue has been deleted (the ghost user). The
action typed author as non-null and read author.login directly, so a
single comment from a deleted account threw and was swallowed into a
generic 'Failed to fetch PR/issue data', failing the entire run.

Make author nullable on the four affected types and fall back to
'ghost' at each login read. With the type nullable, tsc flags every
dereference, so all sites are covered.
2026-07-15 21:00:22 -07:00
2988cbe14a docs: map custom_instructions to --append-system-prompt (#1480) (#1484)
* docs: map custom_instructions to --append-system-prompt (#1480)

The v1 migration guide mapped the v0 `custom_instructions` input to
`claude_args: --system-prompt`, but these have different semantics:
`custom_instructions` *appended* to Claude Code's default system prompt,
while `--system-prompt` *replaces* it entirely. Users who followed the
guide silently lost the whole built-in system prompt (tool-usage guidance,
sub-agent conventions, etc.), keeping only their few custom lines.

Fixes #1480:
- Map `custom_instructions` -> `--append-system-prompt` (matches v0 append
  semantics) in the deprecated-inputs table, the migration example, and the
  checklist.
- Correct the claude_args options table: `--system-prompt` replaces the
  entire prompt; add an `--append-system-prompt` row for append behavior.

Docs-only; no code changes.

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

* docs: fix remaining custom_instructions migration references (#1480)

Update usage.md, faq.md, and configuration.md to map custom_instructions
to --append-system-prompt, matching the migration-guide fix. The
override_prompt row is left unchanged since replacement semantics may be
intended there.

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 20:35:32 -07:00
a1c0599a9c fix(format): filter out thinking_tokens system messages from step summary (#1479)
## Summary

Signed-off-by: anish <anishesg@users.noreply.github.com>
Co-authored-by: anish <anishesg@users.noreply.github.com>
2026-07-15 20:27:23 -07:00
5bfa96a5b0 fix: allow leading underscore in branch names (valid per git-check-ref-format) (#1486)
Branch names starting with an underscore (e.g. _release/v1.2.3) are valid
per git check-ref-format but were rejected by validateBranchName's
first-character whitelist. Since setupBranch validates a PR's baseRefName
after checkout, the action failed on every open PR targeting such a
branch. A leading underscore carries no option-injection risk (only a
leading dash does, which is still rejected separately).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 20:27:12 -07:00
Jianke LINandGitHub 214a70611b fix: map claude_args model to SDK options (#1474) 2026-07-15 20:22:15 -07:00
5f509a1c1f fix(sanitizer): strip alt text from reference-style markdown images (#1488)
stripMarkdownImageAltText removed alt text from inline images
(![alt](url)) but not reference-style images (![alt][ref]), because the
regex requires the "](" of the inline form. Alt text is a
hidden-instruction channel that reaches the prompt via sanitizeContent,
so the reference-style form let it survive.

Add a matching replace for the reference-style form (![alt][ref] ->
![][ref]), preserving the [ref] label so the image definition still
resolves. Adds regression tests.

Co-authored-by: Contributor <you@example.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 20:21:12 -07:00
PaarthandGitHub e64308ff97 fix: sanitize {{label}} in branch name templates (#1492)
A scoped label like area:permissions was substituted into the branch
name verbatim, producing a ":" that validateBranchName rejects. Because
the branch setup block catches that error and calls process.exit(1), the
whole run died. {{description}} was already sanitized via extractDescription;
{{label}} was the only free-text variable that skipped it.

Add a sanitizeLabel helper (replaces invalid-char runs with a hyphen so
scoped labels stay readable) and apply it before substitution, falling back
to entityType when a label sanitizes to empty. Adds regression tests that
also assert the result passes validateBranchName.
2026-07-15 20:21:02 -07:00
58dc33d9ad test: cover prepareContext validation error branches (#1460)
* test: cover prepareContext validation error branches

create-prompt.test.ts exercised only happy paths; the ~20 validation
guards in prepareContext (missing PR_NUMBER, unsupported event type,
unsupported issue action, missing claude branch, etc.) had no coverage.

Adds a "prepareContext validation errors" block asserting the thrown
messages for the reachable guards, using the existing createMockContext
helper.

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

* test: cover comments/common link and body builders

`src/github/operations/comments/common.ts` had no direct test coverage,
though its exports are live code used by create-initial.ts and
update-with-branch.ts. This adds unit tests for all four exports:
SPINNER_HTML, createJobRunLink, createBranchLink, and createCommentBody.

Assertions are built from the imported GITHUB_SERVER_URL so they hold on
GHES as well as github.com. Pure test additions — no production changes.

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 20:20:53 -07:00
evol1228andGitHub ae650f8355 docs: fix dead example links in custom-automations.md (#1513) 2026-07-15 20:18:08 -07:00
GitHub Actions 1298632ce7 chore: bump Claude Code to 2.1.211 and Agent SDK to 0.3.211 v1.0.175 2026-07-15 23:10:52 +00:00
GitHub Actions 1253134445 chore: bump Claude Code to 2.1.210 and Agent SDK to 0.3.210 v1.0.174 2026-07-14 23:46:09 +00:00
NickNojiriandGitHub 4f07c81564 fix(sanitizer): redact GitHub user-to-server (ghu_) tokens (#1502)
redactGitHubTokens covers ghp_, gho_, ghs_, ghr_, and github_pat_
tokens but misses ghu_ (GitHub App user-to-server tokens), one of the
documented GitHub token prefixes. A ghu_ token appearing in issue or
PR content passed through sanitization unredacted.

Add the ghu_ pattern, mirroring the existing 40-character token
patterns, with unit tests including the git-credential URL form.
2026-07-14 13:06:18 -07:00
GitHub Actions f1bd27ca5b chore: bump Claude Code to 2.1.209 and Agent SDK to 0.3.209 v1.0.173 2026-07-14 06:36:42 +00:00
GitHub Actions a08f8913d5 chore: bump Claude Code to 2.1.208 and Agent SDK to 0.3.208 v1.0.172 2026-07-14 01:11:18 +00:00
972a512078 fix(sdk): fail step when result has is_error:true despite success subtype (#1496)
Treat subtype success with is_error:true as a failed run so CI does not
show a misleading green check when the review never actually ran.

Fixes #1495

Co-authored-by: syf2211 <syf2211@users.noreply.github.com>
2026-07-13 09:01:51 -07:00
GitHub Actions e90deca476 chore: bump Claude Code to 2.1.207 and Agent SDK to 0.3.207 v1.0.171 2026-07-11 00:52:42 +00:00