Repository navigation
feat(wiki-write-core): publish to npm from main - #4010
Conversation
…x major releases Use import.meta.main for the entrypoint guard so main() runs from paths that need percent-encoding. Cover the CLI boundary with child-process tests. Reject a major release from a 0.x base in incrementVersion and in the publish validate step.
fro-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS
No material defects found in the nine changed files. Package-scoped release decisions, isolated publish credentials, and version validation are backed by meaningful failure-path tests.
Blocking issues
None
Non-blocking concerns
None
Missing tests
None identified. Focused suites: 154 passed, 21 skipped; skipped cases require the pinned scratch-installed release tools. Workflow YAML shape and action SHA references validated; actionlint was unavailable. Live publishing was not exercised.
Risk assessment (MED) + rationale
This introduces automatic npm publication with write credentials. The separate build/decision jobs, validated publish inputs, disabled lifecycle scripts, and release environment constrain that risk. The environment's main-only policy is author-reported, not independently verified; this follows the boundary described in the dispatch-ref learning.
Run Summary
| Field | Value |
|---|---|
| Event | pull_request |
| Repository | fro-bot/.github |
| Run ID | 39207601450 |
| Cache | hit |
| Session | ses_ead3e80a7ffemQRkNd6NKUZAAM |
| Scope | PR #4010; nine changed files; existing wiki edits excluded |
| Verification | 154 tests passed, 21 skipped; workflow YAML/action references validated |
Part of #3998.
This publishes
@fro.bot/wiki-write-coreto npm frommainwith semantic-release. Only commits that touchpackages/wiki-write-core/cut a release. The package is on the 0.x line, starting from thewiki-write-core-v0.0.0tag on #4004's merge commit. Merging this PR publishes 0.1.0.How a release is decided
scripts/wiki-write-core-release.ts decideperforms these steps:wiki-write-core-v*tag reachable fromHEAD. If no such tag is reachable, it fails.packages/wiki-write-core/, and drops any marked[skip release]or[release skip].@semantic-release/commit-analyzerandrelease-notes-generatoron those commits, usingpackages/wiki-write-core/.releaserc.yaml. That config uses the samereleaseRulesas fro-bot/agent, so breaking changes,featandbuildbump minor andfixbumps patch.A major release from a 0.x base is rejected, both in
decideand again in publish.Workflow
.github/workflows/release-wiki-write-core.yamlruns on push tomainand onworkflow_dispatch.decidebuilddistand fails if it differs from the committeddistpublishcontents: write,id-token: write, environmentrelease.releaserc.json, and runssemantic-release --cipublishruns no repo code.NPM_TOKENand the GitHub token are set only on thesemantic-releasestep.env, and Renovate tracks them. A new packageRule turns patch updates back on for them.Bootstrap state
releaseenvironment exists, with a deployment-branch policy that allows onlymain.NPM_TOKENis set as an environment secret onrelease. It is a granular token scoped to@fro.bot, for this first publish only.wiki-write-core-v0.0.0points at084b58f.After this PR: configure the npm trusted publisher for
release-wiki-write-core.yamland environmentrelease, then removeNPM_TOKENin a follow-up so later releases publish through OIDC. On the same day, revoke the token and delete the secret.Verification
pnpm check-types,pnpm lint,pnpm test(5620 passed),actionlint,pnpm check:mutation-guardsandpnpm check:renovate-configall exit 0. The lockfile is unchanged.main(a clone with the realwiki-write-core-v0.0.0tag) anddecidereturnedtype=minor,version=0.1.0,base-tag=wiki-write-core-v0.0.0.semantic-release --dry-runwith the gated config. It accepted 0.1.0 and rejected 0.2.0 atverifyRelease.