From fdefa5939e92ef442c6d276269790031bcd7700c Mon Sep 17 00:00:00 2001 From: Sam Morrow Date: Thu, 21 May 2026 23:15:17 +0200 Subject: [PATCH] ci(mcp-diff): build UI artifacts available to baseline checkout 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> --- .github/workflows/mcp-diff.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mcp-diff.yml b/.github/workflows/mcp-diff.yml index 305428923..f901e31f8 100644 --- a/.github/workflows/mcp-diff.yml +++ b/.github/workflows/mcp-diff.yml @@ -27,6 +27,16 @@ jobs: - name: Build UI uses: ./.github/actions/build-ui + - name: Stash UI artifacts for baseline checkout + # mcp-server-diff checks the baseline ref out into a separate working + # directory and runs install_command there. Without these prebuilt + # artifacts, pkg/github/ui_dist/ would be empty on the baseline side + # and UIAssetsAvailable() would return false, producing a false-positive + # diff that "adds" _meta.ui to MCP Apps tools on every PR. + run: | + mkdir -p "${RUNNER_TEMP}/ui_dist" + cp pkg/github/ui_dist/*.html "${RUNNER_TEMP}/ui_dist/" + - name: Generate diff configurations id: configs # The generator imports pkg/github so any new entry in @@ -43,7 +53,10 @@ jobs: uses: SamMorrowDrums/mcp-server-diff@v2.3.5 with: setup_go: "false" - install_command: go mod download + install_command: | + go mod download + mkdir -p pkg/github/ui_dist + cp "${RUNNER_TEMP}"/ui_dist/*.html pkg/github/ui_dist/ start_command: go run ./cmd/github-mcp-server stdio env_vars: | GITHUB_PERSONAL_ACCESS_TOKEN=test-token @@ -79,6 +92,13 @@ jobs: - name: Build UI uses: ./.github/actions/build-ui + - name: Stash UI artifacts for baseline checkout + # See the stdio job above for rationale: the action's baseline checkout + # has no UI artifacts unless we hand them over via RUNNER_TEMP. + run: | + mkdir -p "${RUNNER_TEMP}/ui_dist" + cp pkg/github/ui_dist/*.html "${RUNNER_TEMP}/ui_dist/" + - name: Generate diff configurations id: configs # See script/print-mcp-diff-configs/main.go. The http-headers variant @@ -97,7 +117,10 @@ jobs: uses: SamMorrowDrums/mcp-server-diff@v2.3.5 with: setup_go: "false" - install_command: go mod download + install_command: | + go mod download + mkdir -p pkg/github/ui_dist + cp "${RUNNER_TEMP}"/ui_dist/*.html pkg/github/ui_dist/ http_start_command: go run ./cmd/github-mcp-server http --port 8082 http_startup_wait_ms: "5000" configurations: ${{ steps.configs.outputs.configurations }}