Skip to content

Commit 0b644d7

Browse files
ci(mcp-diff): build UI artifacts available to baseline checkout (#2523)
The mcp-server-diff action checks the baseline ref out into a separate working directory and runs install_command there. Without prebuilt UI artifacts, pkg/github/ui_dist/ is empty on the baseline side and UIAssetsAvailable() returns false, producing a false-positive diff that "adds" _meta.ui to MCP Apps tools on every PR. Stash the artifacts to RUNNER_TEMP after the workflow's build-ui step, then restore them from install_command so both the baseline and PR checkouts register identical MCP Apps UI metadata. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6fd9d07 commit 0b644d7

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/mcp-diff.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ jobs:
2727
- name: Build UI
2828
uses: ./.github/actions/build-ui
2929

30+
- name: Stash UI artifacts for baseline checkout
31+
# mcp-server-diff checks the baseline ref out into a separate working
32+
# directory and runs install_command there. Without these prebuilt
33+
# artifacts, pkg/github/ui_dist/ would be empty on the baseline side
34+
# and UIAssetsAvailable() would return false, producing a false-positive
35+
# diff that "adds" _meta.ui to MCP Apps tools on every PR.
36+
run: |
37+
mkdir -p "${RUNNER_TEMP}/ui_dist"
38+
cp pkg/github/ui_dist/*.html "${RUNNER_TEMP}/ui_dist/"
39+
3040
- name: Generate diff configurations
3141
id: configs
3242
# The generator imports pkg/github so any new entry in
@@ -43,7 +53,10 @@ jobs:
4353
uses: SamMorrowDrums/mcp-server-diff@v2.3.5
4454
with:
4555
setup_go: "false"
46-
install_command: go mod download
56+
install_command: |
57+
go mod download
58+
mkdir -p pkg/github/ui_dist
59+
cp "${RUNNER_TEMP}"/ui_dist/*.html pkg/github/ui_dist/
4760
start_command: go run ./cmd/github-mcp-server stdio
4861
env_vars: |
4962
GITHUB_PERSONAL_ACCESS_TOKEN=test-token
@@ -79,6 +92,13 @@ jobs:
7992
- name: Build UI
8093
uses: ./.github/actions/build-ui
8194

95+
- name: Stash UI artifacts for baseline checkout
96+
# See the stdio job above for rationale: the action's baseline checkout
97+
# has no UI artifacts unless we hand them over via RUNNER_TEMP.
98+
run: |
99+
mkdir -p "${RUNNER_TEMP}/ui_dist"
100+
cp pkg/github/ui_dist/*.html "${RUNNER_TEMP}/ui_dist/"
101+
82102
- name: Generate diff configurations
83103
id: configs
84104
# See script/print-mcp-diff-configs/main.go. The http-headers variant
@@ -97,7 +117,10 @@ jobs:
97117
uses: SamMorrowDrums/mcp-server-diff@v2.3.5
98118
with:
99119
setup_go: "false"
100-
install_command: go mod download
120+
install_command: |
121+
go mod download
122+
mkdir -p pkg/github/ui_dist
123+
cp "${RUNNER_TEMP}"/ui_dist/*.html pkg/github/ui_dist/
101124
http_start_command: go run ./cmd/github-mcp-server http --port 8082
102125
http_startup_wait_ms: "5000"
103126
configurations: ${{ steps.configs.outputs.configurations }}

0 commit comments

Comments
 (0)