ci: automated npm publishing via OIDC, PR tests and Slack notifications - #11
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three workflows: test on every PR, publish to npm automatically when the version on
mainchanges, and Slack notifications for both.ci.ymlRuns
npm teston every pull request and on pushes tomain, across Node 18, 20 and 22 (enginesdeclares>=18). Good candidate for a required status check onmain.publish.ymlTriggers on a push to
mainthat touchespackage.json, so bumping the version in a PR and merging it is the release — no tags to cut by hand.package.jsonedits don't fail the run.NPM_TOKENsecret. Provenance attestations are generated automatically. Requires Node 22 / npm >= 11.5.1, hence thenpm install -g npm@lateststep.v<version>and creates a GitHub release with generated notes.workflow_dispatchis deliberately absent — npm warns it can cause OIDC validation mismatches.pr-notify.ymlPosts to Slack when a PR targeting
mainis opened, and again when it merges. Draft PRs are skipped; closed-without-merge posts nothing. Payloads are built withjqso PR titles containing quotes can't break the JSON.Setup required before the first publish
/package/plain-forge/access→ Trusted Publisher → GitHub Actions, with orgCodeplain-ai, repoplain-forge, workflow filenamepublish.yml, environment blank. The filename is part of the trust contract — renaming the workflow later breaks publishing until it's updated there.SLACK_WEBHOOK_URLrepository secret — already added. Every notify step is guarded on it being non-empty, so the workflows still run cleanly without it.All notifications share the one
plain-forgewebhook, so a version-bump merge produces: merged to main → publishing → published.