Add npm publish workflow with OIDC trusted publishing#8
Open
Conversation
Adds a workflow_dispatch workflow (.github/workflows/publish.yml) that: - Accepts version_type input (major/minor/patch, default patch) - Determines next version from the latest npm-published version - Publishes to npm using OIDC trusted publishing (no tokens needed) - Creates a GitHub release with auto-generated notes and npm tarball - Pipes command output to GITHUB_STEP_SUMMARY for visibility - Hardens against script injection using environment variables Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a manually triggered GitHub Actions workflow to publish the package to npm using OIDC trusted publishing, and to create a corresponding GitHub Release with generated notes and the npm tarball attached.
Changes:
- Introduces a
workflow_dispatchpublish workflow with aversion_type(major/minor/patch) input. - Computes the next version from the latest npm-published version, builds the package, packs, and publishes to npm.
- Creates a GitHub Release with autogenerated notes (optionally starting from the previous release tag) and attaches the packed tarball.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/publish.yml |
New workflow to compute a next version, publish to npm via OIDC, and create a GitHub Release with notes and the tarball asset. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 7
- Use semver package for robust version incrementing - Filter out drafts and pre-releases when finding previous tag - Add concurrency guard to prevent publish races - Enable npm caching in setup-node Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 a
workflow_dispatchworkflow (.github/workflows/publish.yml) for publishing to npm.Features
version_type(major/minor/patch, default patch)npm-publishenvironment + trusted publisher config on npmjs.com)--notes-start-tagfrom previous release) and attaches the npm tarballnpm publishandgh release createoutput to$GITHUB_STEP_SUMMARY; key version info written progressively