Skip to content

Commit 3ac6b08

Browse files
fix(release): auto-sync the UI's MCP version copy after every mcp publish
apps/loopover-ui/src/lib/mcp-package.ts's MCP_PACKAGE_KNOWN_LATEST_VERSION (ui:version-audit, already CI-enforced) goes stale the moment mcp publishes a new version -- and since nothing updated it automatically, that showed up as a completely unrelated PR's CI turning red with zero connection to what it actually changed (confirmed live: an auto-generated release PR for a DIFFERENT package hit this exact gap twice in one session, #7115 and #7134). Can't be pre-synced in the Release PR itself: the value must never claim a version ahead of what's actually on npm (the check's own header comment already establishes this), so the earliest correct moment to update it is right after publish succeeds. Opens a small PR instead of pushing to main directly, since this repo's branch protection requires PRs.
1 parent 237530a commit 3ac6b08

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/publish-mcp.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,57 @@ jobs:
220220
tarball=$(find "$RUNNER_TEMP/loopover-mcp-package" -maxdepth 1 -type f -name "*.tgz" -print -quit)
221221
npx -y npm@11.15.0 publish "$tarball" --access public --provenance
222222
223+
# apps/loopover-ui/src/lib/mcp-package.ts's MCP_PACKAGE_KNOWN_LATEST_VERSION (ui:version-audit,
224+
# already CI-enforced) tracks the latest PUBLISHED release -- its own header comment explains why
225+
# it can't be pre-synced in the Release PR itself: it must never claim a version ahead of npm, so
226+
# the earliest correct moment to update it is right here, after publish actually succeeds. Left as
227+
# a manual "did anyone notice CI red and run the sync command" step before, this blocked completely
228+
# unrelated PRs' CI with zero connection to what they actually changed (confirmed live: an
229+
# auto-generated release PR for a DIFFERENT package went red on this exact gap, twice in one
230+
# session). Opens a small PR instead of pushing straight to main: this repo's branch protection
231+
# requires PRs (required_pull_request_reviews), so a direct push would just be rejected.
232+
sync-ui-version-copy:
233+
runs-on: ubuntu-latest
234+
needs: [validate, publish]
235+
if: ${{ !cancelled() && needs.publish.result == 'success' }}
236+
timeout-minutes: 10
237+
permissions:
238+
contents: read
239+
steps:
240+
- name: Checkout
241+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
242+
with:
243+
persist-credentials: false
244+
- name: Setup Node
245+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
246+
with:
247+
node-version: 24.18.0
248+
- name: Sync and open a PR if the known-latest copy is now stale
249+
env:
250+
# A real collaborator token, not github.token -- mirrors mcp-release-please.yml's own
251+
# rationale: PRs/commits pushed as github-actions[bot] repeatedly get re-flagged as needing
252+
# manual workflow-run approval, which a real account sidesteps.
253+
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
254+
run: |
255+
set -euo pipefail
256+
node scripts/check-ui-mcp-version-copy.mjs --write
257+
if git diff --quiet apps/loopover-ui/src/lib/mcp-package.ts; then
258+
echo "Already in sync, nothing to do."
259+
exit 0
260+
fi
261+
git config user.name "github-actions[bot]"
262+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
263+
branch="chore/sync-mcp-version-copy-${{ needs.validate.outputs.version }}"
264+
git checkout -B "$branch"
265+
git add apps/loopover-ui/src/lib/mcp-package.ts
266+
git commit -m "chore(ui): sync MCP_PACKAGE_KNOWN_LATEST_VERSION with npm dist-tags.latest"
267+
git remote set-url origin "https://github.com/${GITHUB_REPOSITORY}.git"
268+
gh auth setup-git
269+
git push origin "HEAD:$branch"
270+
gh pr create --repo "$GITHUB_REPOSITORY" --base main --head "$branch" \
271+
--title "chore(ui): sync MCP_PACKAGE_KNOWN_LATEST_VERSION with npm dist-tags.latest" \
272+
--body "Automated: @loopover/mcp v${{ needs.validate.outputs.version }} just published to npm; keeps apps/loopover-ui/src/lib/mcp-package.ts's known-latest-version copy in sync (ui:version-audit)."
273+
223274
github-release:
224275
runs-on: ubuntu-latest
225276
needs: [validate, publish]

0 commit comments

Comments
 (0)