Add workflow to release packages to npm#23063
Conversation
b40c0a5 to
c709bbf
Compare
0e0bc42 to
febf6c1
Compare
| publish: | ||
| name: Publish NPM packages (dry-run) | ||
| runs-on: ubuntu-latest | ||
| environment: npm-publish |
There was a problem hiding this comment.
as @Dieterrr said the optional environment key
allows you to scope secrets to workflows per env.
So I'd say that for this dry-run workflow we don’t need any publish secrets or extra approvals involved. 🤔
There was a problem hiding this comment.
I actually think we need that to flag to the user that this is required for the published workflow.
There was a problem hiding this comment.
Then if we are going to add secrets to the npm-publish I think we should use a different key for the dry-run than for the real workflow to avoid granting access to those publish secrets e.g. npm-publish-dry-run? 🤔
There was a problem hiding this comment.
The dry-run only runs npm pack and uploads a tarball artifact — it can't publish anything, so there actually no need for environment in the pre publish workflow. My mistake.
It won't validate whether trusted publishing is configured correctly on npmjs.com.
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions automation to publish selected workspace packages to npm when a “Version increase” PR with the npm-release label is merged into trunk, plus a PR-time dry-run (npm pack) check.
Changes:
- Adds a
publish-npm-packages.ymlworkflow that publishes packages based on a list extracted from the PR content. - Adds a
pre-publish-npm-packages.ymlworkflow that runs a dry-run pack and uploads resulting tarballs as an artifact. - Implements basic strategy selection per package (
prepublishOnly/build/ direct) before publishing/packing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| .github/workflows/publish-npm-packages.yml | Publishes selected packages to npm on merge of a labeled “Version increase” PR. |
| .github/workflows/pre-publish-npm-packages.yml | Runs a dry-run npm pack for selected packages on PR label/sync and uploads artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JorPV
left a comment
There was a problem hiding this comment.
I added more small suggestions 😄
Context
npm-releaselabel. The list of packages to release should be included in the PR body before the ## Context heading, in the format- @yoast/package-name: version.npm-releaselabel.Summary
This PR can be summarized in the following changelog entry:
Version increasePR withnpm-releaselabel to trunk. If Workflow fails it can be triggered manually with PR number.npm-releaselabel.Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand commited the results, if my PR introduces new images or SVGs.Innovation
innovationlabel.Fixes #