Summary
The test-* workflows and claude-review.yml run the action against the Claude API, authenticated via workload identity federation. Fork PRs can't mint the OIDC token that gets exchanged for an access token, so every one of those jobs failed on external contributions and buried the real signal from ci.yml.
This gates each such job on the PR head repo matching the base repo, the same way claude-agent-sdk-python does:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
- The
event_name != 'pull_request' arm keeps push and workflow_dispatch runs unaffected. Since github.event_name is inherited by workflow_call, this also covers the ci-all.yml path.
test-structured-output.yml's test-summary job folds the gate into its existing always() so it doesn't run and exit 1 against all-skipped needs.
claude-review.yml only fires on pull_request, so it uses the plain repo comparison.
ci.yml (test / prettier / typecheck) is unchanged and still runs on fork PRs. claude.yml and issue-triage.yml are comment/issue-event driven and run in the base repo context, so they're untouched too.
Also: fix test/fetch-depth.test.ts on CI (unrelated, but it was red on main)
setupBranch fetch depth > still limits the depth on an already shallow checkout (added in #1647) fails on ubuntu-latest. The test creates its bare remote with a plain git init --bare, so the remote's HEAD points at init.defaultBranch (master on the runner) while the test only pushes main. git clone --depth=1 implies --single-branch, and with a dangling remote HEAD git falls back to "You appear to have cloned an empty repository" — no commits, no .git/shallow, so --is-shallow-repository is false. It passed locally for anyone whose default branch is main.
Fixed by creating the bare remote with --initial-branch=main. Verified locally: fails 1/4 with GIT_CONFIG_GLOBAL set to init.defaultBranch=master before, 4/4 after.
Test plan
-
bun test green locally, including under a simulated init.defaultBranch=master
- Same-repo PR: all Claude-backed jobs still run and
ci / test is green (this PR)
- Fork PR: Claude-backed jobs show as skipped,
ci / * still runs
-
push to main via ci-all.yml: Claude-backed jobs still run