ci: automate npm publishing of the portable skill - #4
Conversation
Add .github/workflows/publish-skill.yml to publish skill/infographic-agent to npm automatically. On a push to main that changes the skill, it reads the version from package.json and publishes only if that version is not already on npm — so a version bump releases, while doc/script edits are safe no-ops. Includes npm provenance (OIDC), package sanity checks, and a skill-v<version> git tag on release. Also runnable manually via workflow_dispatch. Document the flow and the required NPM_TOKEN secret in docs/releasing.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA5q9TqsQjnmj6myJeB1g
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2844518643
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| concurrency: | ||
| group: publish-skill | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
Queue all pending release runs
This release workflow publishes immutable npm versions, but this concurrency block leaves GitHub Actions at the default queue: single behavior; GitHub documents that a newly queued run cancels and replaces an existing pending run in the same group. If several skill/infographic-agent version-bump pushes land while one publish is still running, an earlier pending version can be canceled and never published or tagged. Add queue: max or another queueing strategy so every release run is processed.
Useful? React with 👍 / 👎.
| branches: [main] | ||
| paths: | ||
| - 'skill/infographic-agent/**' | ||
| workflow_dispatch: |
There was a problem hiding this comment.
Restrict manual publishes to main
The manual trigger is not guarded by branch, and GitHub's manual-run flow allows selecting a branch/ref to run the workflow on. In that scenario a maintainer can accidentally publish and tag a package version from an unmerged feature branch even though the push trigger is main-only, because the publish/tag steps do not re-check github.ref. Add a job or publish-step condition for refs/heads/main before exposing the npm token.
Useful? React with 👍 / 👎.
Pull Request
Summary
Adds automated CI/CD publishing for the portable skill (
infographic-agenton npm) so releases are "automagic": bump the version inskill/infographic-agent/package.json, merge tomain, and CI publishes it — no manualnpm publishfrom a laptop.Changes
.github/workflows/publish-skill.yml— triggers on pushes tomainthat touchskill/infographic-agent/**(plus manualworkflow_dispatch). It:node --check,py_compile,npm pack --dry-run),package.jsonand checks npm,npm publish --provenance --access public(supply-chain attestation via GitHub OIDC), andskill-v<version>git tag.docs/releasing.md— documents the release flow and the one-timeNPM_TOKENsecret setup.Action required before this can publish
NPM_TOKEN(npm Automation/granular token with publish rights forinfographic-agent). Steps are indocs/releasing.md.Ordering note
npmcurrently hasinfographic-agent@2.0.1; the newskill/infographic-agent/package (v3.0.0) arrives via #3. This workflow is dormant until that package exists onmainand only ever publishes a version that isn't already on npm, so merging it early cannot ship a stale build. Once #3 lands, either the next skill change triggers it or you run it once from the Actions tab.How Tested
npm run lint) — n/a: no app source touched.npm test) — n/a: no app source touched.npm run build) — n/a: no app source touched.publishjob, 6 steps). Publish/version-check logic is guarded so it no-ops on unchanged versions; verifiednpm view infographic-agent versionsreturns only2.0.1, so 3.0.0 will be treated as new.Screenshots
No UI changes (CI + docs only).
🤖 Generated with Claude Code
Generated by Claude Code