Skip to content

CI: answer @claude mentions, fork PRs included, on the maintainer's subscription - #1468

Merged
GLinnik21 merged 5 commits into
mainfrom
ci/claude-mentions
Nov 19, 2026
Merged

GLinnik21 merged 5 commits into
mainfrom
ci/claude-mentions

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Adds .github/workflows/claude.yml. An @claude mention runs anthropics/claude-code-action (pinned to v1.0.283), signed in with the maintainer's Claude subscription through the CLAUDE_CODE_OAUTH_TOKEN secret, which is already set. Its main job is reviewing PRs, including PRs from outside contributors' forks.

Who can start it

  • Only an OWNER, MEMBER or COLLABORATOR starts a runner. The action then re-checks write access and refuses bots.
  • On a fork PR, only a conversation comment works. GitHub gives a fork's review and inline-comment events no secrets.

Why a fork PR can't run code or publish

  • The action checks out the PR head and restores only .claude/, CLAUDE.md and AGENTS.md from main. Skills, agents (through the .claude -> .agents links), nested guides and tools/ are the fork's.
  • Token: the job's own GITHUB_TOKEN, with contents: read, PR and issue write, and actions: read. It can't push a branch or a v* tag, so it can't trigger release.yml.
  • No OIDC: there is no id-token: write, so the job can't satisfy the Anthropic federation rule issue-labels.yml uses.
  • No checkout tooling: hooks are off (the SessionEnd hook would run the fork's tools/build-gc.sh). Skills, subagents and skill shell commands are off. tools/ scripts are denied.
  • Commands: curl, wget, gh, git push and git tag are denied, and so is Read of /proc. These are prefix rules, so the token scope and the scrub are the real limits.
  • Credentials: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 strips them from Claude's commands, and bubblewrap runs those commands in their own PID namespace.
  • Comments: Claude posts inline review comments through the action's tool. Comments are signed github-actions[bot].

What this gives up

  • On issues, Claude can't push a branch, so it's review and comment only.
  • Reviews are single-agent: the repo's subagents and skills are off.

Review

  • pr-reviewer, one round on the first commit: BLOCKER (hooks run fork code), MAJOR and MINOR, all fixed.
  • Fable security review, two rounds. Round 1 said not safe to merge: fork skills, the org-wide App token reaching releases, and scrub gaps. Round 2 at 93b8a4e said safe to merge, plus two deny rules (tools/, /proc) added here.
  • Still a repository setting, outside this PR: a tag ruleset that limits v* creation to admins and the deploy key.

Checks

Build bench

  • Not applicable: mention-only workflow, no build input changed.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits November 19, 2026 05:03
…s subscription

Adds .github/workflows/claude.yml: issue, PR comment, inline review comment and
review-body mentions of @claude run anthropics/claude-code-action (pinned to
v1.0.283), signed in with the CLAUDE_CODE_OAUTH_TOKEN secret from
`claude setup-token`. Only owners, members and collaborators start a runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts work

A fork PR's head is checked out with only .claude/ and the instruction files
restored from the base, so the SessionEnd hook would run the fork's
tools/build-gc.sh with the token in its environment. Also scrub subprocess
credentials, drop the no-op `assigned` trigger, and correct the header: on a
fork PR only conversation comments get secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the job's read-only GITHUB_TOKEN instead of the org-wide App token (no push,
no tag, no OIDC), turn off skills and subagents (on a fork they are the
contributor's, through the .claude -> .agents links), disallow network and
publishing commands, and sandbox Claude's commands with bubblewrap. Header
rewritten to say what comes from the fork and what each guard is for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nstall

ci/test_ci_timeouts.py requires every apt-get update under `timeout`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inline review comments

Second security review: .claude/settings.json allows tools/ scripts that on a
fork are the contributor's, and Read could open /proc/self/environ. Also turn
on the inline-comment tool, and say plainly that the command rules are prefix
rules and the token scope and scrub are the real limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GLinnik21 GLinnik21 changed the title CI: answer @claude mentions with the Claude Code Action on the maintainer's subscription CI: answer @claude mentions, fork PRs included, on the maintainer's subscription Nov 19, 2026
@GLinnik21
GLinnik21 merged commit 8cb98a9 into main Nov 19, 2026
9 checks passed
@GLinnik21
GLinnik21 deleted the ci/claude-mentions branch November 19, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant