fix(mcp): build gittensory-engine before the publish gate + switch to workflow_dispatch - #4135
Conversation
… workflow_dispatch The MCP release validation gate imports src/mcp/find-opportunities.ts transitively (via gittensory-miner's opportunity-fanout.js), which needs @jsonbored/gittensory-engine's gitignored dist/ built first -- ci.yml already has this step, npm-publish.yml never did, so every publish attempt failed before reaching npm (reproduced today on the mcp-v0.7.0 tag; nothing was published). Also switches the trigger from push:tags: to workflow_dispatch, since a GITHUB_TOKEN-created tag (from the release automation landing next) won't fire a push-triggered workflow. The version/tag are now resolved from the dispatched commit's package.json instead of the tag ref.
Splits the single publish job into an unprivileged validate job (contents: read, runs npm ci/build/test:release:mcp/pack) and a privileged publish job (contents: write, id-token: write, environment: release) that only downloads the already-tested tarball and publishes it -- no dependency install/build ever runs with write or OIDC-token access (P2: a compromised build dependency could otherwise abuse contents:write to push arbitrary tags). Also gates the publish job behind the existing `release` GitHub environment (same one release-selfhost.yml already uses), requiring reviewer approval per repo Settings > Environments before a real npm publish can run (P1: a workflow_dispatch trigger has no branch/tag restriction on its own).
grep -E without -q prints the matching line to stdout before the if condition even evaluates it, so a real secret accidentally packaged into the tarball would get echoed straight into the (world-readable) Actions log by the very step meant to catch it. -q keeps the exit-code check, drops the echo.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4135 +/- ##
=======================================
Coverage 93.71% 93.71%
=======================================
Files 385 385
Lines 36197 36197
Branches 13264 13264
=======================================
Hits 33921 33921
Misses 1618 1618
Partials 658 658 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 07:40:45 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
#4135 (fix(mcp): build gittensory-engine before the publish gate + switch to workflow_dispatch) merged after PR #4132 originally generated this changelog, and it's classified as a direct MCP-relevant commit (touches .github/workflows/npm-publish.yml), so changelog:check:mcp correctly flagged the committed file as stale relative to the new mcp-v0.6.0..HEAD range. Regenerated -- 251 commits now, one new line.
Summary
npm-publish.ymlnever built@jsonbored/gittensory-enginebefore running the MCP release validation gate, unlikeci.yml. That package'sdist/is gitignored, so every publish attempt fails the moment the test suite importssrc/mcp/find-opportunities.ts(transitively pulls ingittensory-engineviagittensory-miner'sopportunity-fanout.js).mcp-v0.7.0tag triggered the workflow, which failed at the "MCP release validation gate" step — before the tarball/publish steps, so nothing was published to npm.push: tags:toworkflow_dispatch, needed for the release-automation follow-up (aGITHUB_TOKEN-created tag doesn't fire push-triggered workflows). Version/tag are now resolved from the dispatched commit'spackage.jsonrather than the tag ref; the tag is created if it doesn't already exist (self-tag, matching the old manual flow) or verified to point at HEAD if it does.Test plan
npm run actionlint— cleanpackages/gittensory-engine/distand confirmingrequire("@jsonbored/gittensory-engine")fails the same way; confirmednpm run build --workspace @jsonbored/gittensory-engineresolves itmainto complete the stalledmcp-v0.7.0publish (tag already exists, points at the merged v0.7.0 commit)