ci: restore the Claude Code workflow and .mcp.json, lost in the v2 tree swap - #1851
ci: restore the Claude Code workflow and .mcp.json, lost in the v2 tree swap#1851cliffhall wants to merge 2 commits into
Conversation
Closes #1850. Restored byte-for-byte from ac3c1a1 (sha256 1c44f2d9d51c936adb40c9acefd4b44628fe7810360e2f8196034347f9d2602d, 3592 bytes). No content changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAt8rqxysNbhYWLhoRm3fU
55a76dc to
b225443
Compare
The restored workflow runs with `--mcp-config .mcp.json` and `--allowedTools "Bash,mcp__mcp-docs"`, so without this file the mcp-docs server never registers and those tools do not resolve. Lost in the same tree swap: .mcp.json survives only on v1/main, and is absent from both main and v2/main. Restored byte-for-byte from 47f9284 (sha256 b0f0b8ea0d6c6e4bd9d19270db8c4ed13a951c6a7d8fa9a7b76d0d12ddd2491f, 123 bytes). No content changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAt8rqxysNbhYWLhoRm3fU
There was a problem hiding this comment.
Pull request overview
Restores the Claude Code GitHub Actions workflow and its .mcp.json MCP server configuration to the v2/main tree so the integration isn’t silently lost again in future tree swaps, and so @claude automation can be re-enabled once v2/main is merged back into the default branch.
Changes:
- Add back
.github/workflows/claude.ymlto re-enable Claude Code triggers on issue/PR comment and review events. - Add back
.mcp.jsonso the workflow’s--mcp-config .mcp.jsonandmcp__mcp-docstool allowance can resolve the docs MCP server.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.mcp.json |
Restores MCP server configuration used by the Claude workflow (mcp-docs HTTP server). |
.github/workflows/claude.yml |
Restores the Claude Code workflow that reacts to @claude mentions and runs the Claude Code action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const pr = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: prNumber | ||
| }); | ||
| core.setOutput('sha', pr.data.head.sha); | ||
| core.setOutput('repo', pr.data.head.repo.full_name); |
| (github.event_name == 'issues' && | ||
| (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && | ||
| contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) |
|
Superseded by #1869 — same commits, same content. This PR was auto-closed by GitHub when its head branch was renamed #1869's description also corrects a claim made here: this PR said |
Same regression class as #1843 (
SECURITY.md): the v2 tree swap replaced the default branch's tree, and neither.github/workflows/claude.ymlnor.mcp.jsonexisted in the v2 tree, so both were silently dropped.Impact
issue_comment/pull_request_review_comment/issuesevents always run workflows from the default branch, so losing the workflow disabled@clauderepo-wide — including on PRs targetingv2/main.Found the hard way: two
@claude reviewcomments on #1847 (19:08 and 19:10 UTC) produced no bot reply and no workflow run.Evidence
actions/workflows/173749385statedeletedissue_comment, latest 03:10 UTC today)skipped.github/workflows/onmainmain.ymlac3c1a12(last commit carrying the file)mainThe change
Two files, both restored byte-for-byte, both verified after the copy:
.github/workflows/claude.ymlac3c1a121c44f2d9d51c936adb40c9acefd4b44628fe7810360e2f8196034347f9d2602d.mcp.json47f92841(v1/main)b0f0b8ea0d6c6e4bd9d19270db8c4ed13a951c6a7d8fa9a7b76d0d12ddd2491fNo content changes to either. The
@claudetrigger remains gated toOWNER/MEMBER/COLLABORATORauthor associations, which is the behavior we want under the issues-only contribution model (#1820).Why
.mcp.jsonis in the same PRThe workflow runs with
--mcp-config .mcp.jsonand--allowedTools "Bash,mcp__mcp-docs"..mcp.jsonregisters themcp-docsHTTP server (https://modelcontextprotocol.io/mcp) and was lost in the same swap — it survives only onv1/main:Restoring the workflow without it would register no MCP server, so the
mcp__mcp-docstools would not resolve and the protocol-documentation lookups that--append-system-promptexplicitly directs it to make would silently do nothing. Shipping them together avoids a window where the workflow is onv2/mainpointing at a file that isn't.Why this targets
v2/mainand notmainThis PR originally targeted
main. It now targetsv2/main, the develop branch that merges intomainat milestone releases.The two branches share no common git ancestor —
git merge-base main v2/mainreturns nothing, because the tree swap created unrelated histories. A branch cut frommainand opened againstv2/maintherefore diffs the entire v1 tree against the entire v2 tree, which is what made this PR read as conflicted across a dozen files it never touched. It has been rebuilt onv2/main; the diff is now the two files above and nothing else.Landing on
v2/mainis also what makes the fix durable: restoring only tomainwould be undone by the next milestone tree swap, which is precisely how these files were lost.Verifying after merge
@claudecannot work until this reachesmain, which happens at the next milestone merge — a workflow on a non-default branch is not consulted forissue_commentevents. After that, comment@claude reviewon any open PR;claude[bot]should reply within ~20s (it took 19s on #1825). If it's needed before the milestone, that wants a separate direct-to-mainPR in addition to this one.Testing
No source files are touched, so nothing in
validateorcoveragemeasures this change — the format globs covercore/,scripts/, the shared surface, and each client's scope, none of which reach a workflow YAML or a root-level JSON.npx prettier --check .mcp.jsonpasses. I did not run the fullnpm run cigate, as it would measure nothing here.Note
SECURITY.md(#1843, plus #1864/#1865 for thev2/mainhalf),claude.yml, and.mcp.jsonare three instances of one pattern, and none was caught by CI. A sweep for anything else the swap dropped is worth doing separately — since the histories are unrelated, no git tooling will surface them on its own.