From d9f5bd210352fcffa9931a4a3175a096f5266444 Mon Sep 17 00:00:00 2001 From: Rahul Pandey Date: Fri, 3 Feb 2023 12:17:59 +0530 Subject: [PATCH 1/3] Fixes automatically publish package. --- .../publishing-packages/publishing-nodejs-packages.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/actions/publishing-packages/publishing-nodejs-packages.md b/content/actions/publishing-packages/publishing-nodejs-packages.md index 61332f6d51ef..eb43c0c4eb4f 100644 --- a/content/actions/publishing-packages/publishing-nodejs-packages.md +++ b/content/actions/publishing-packages/publishing-nodejs-packages.md @@ -51,7 +51,7 @@ If you add steps in your workflow to configure the `publishConfig` fields in you ## Publishing packages to the npm registry -Each time you create a new release, you can trigger a workflow to publish your package. The workflow in the example below runs when the `release` event triggers with type `created`. The workflow publishes the package to the npm registry if CI tests pass. +You can trigger a workflow to publish your NPM package every time you [publish a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release). The process in the following example is executed when the release event of type 'published' is triggered. If the CI tests pass, the process uploads the package to the npm registry. To perform authenticated operations against the npm registry in your workflow, you'll need to store your npm authentication token as a secret. For example, create a repository secret called `NPM_TOKEN`. For more information, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)." @@ -65,7 +65,7 @@ This example stores the `NPM_TOKEN` secret in the `NODE_AUTH_TOKEN` environment name: Publish Package to npmjs on: release: - types: [created] + types: ['published'] jobs: build: runs-on: ubuntu-latest @@ -94,7 +94,7 @@ Please note that you need to set the `registry-url` to `https://registry.npmjs.o ## Publishing packages to {% data variables.product.prodname_registry %} -Each time you create a new release, you can trigger a workflow to publish your package. The workflow in the example below runs anytime the `release` event with type `created` occurs. The workflow publishes the package to {% data variables.product.prodname_registry %} if CI tests pass. +You can trigger a workflow to publish your NPM package every time you [publish a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release). The process in the following example is executed when the release event of type 'published' is triggered. If the CI tests pass, the process uploads the package to the npm registry. ### Configuring the destination repository @@ -125,7 +125,7 @@ This example stores the `GITHUB_TOKEN` secret in the `NODE_AUTH_TOKEN` environme name: Publish package to GitHub Packages on: release: - types: [created] + types: ['published'] jobs: build: runs-on: ubuntu-latest @@ -163,7 +163,7 @@ If you use the Yarn package manager, you can install and publish packages using name: Publish Package to npmjs on: release: - types: [created] + types: ['published'] jobs: build: runs-on: ubuntu-latest From c5bf595b04a3ad34038a77ef01f884d000e01482 Mon Sep 17 00:00:00 2001 From: Rahul Pandey Date: Fri, 3 Feb 2023 12:30:37 +0530 Subject: [PATCH 2/3] little bit of modification --- .../publishing-packages/publishing-nodejs-packages.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/actions/publishing-packages/publishing-nodejs-packages.md b/content/actions/publishing-packages/publishing-nodejs-packages.md index eb43c0c4eb4f..b9563a8a3f83 100644 --- a/content/actions/publishing-packages/publishing-nodejs-packages.md +++ b/content/actions/publishing-packages/publishing-nodejs-packages.md @@ -65,7 +65,7 @@ This example stores the `NPM_TOKEN` secret in the `NODE_AUTH_TOKEN` environment name: Publish Package to npmjs on: release: - types: ['published'] + types: [published] jobs: build: runs-on: ubuntu-latest @@ -125,7 +125,7 @@ This example stores the `GITHUB_TOKEN` secret in the `NODE_AUTH_TOKEN` environme name: Publish package to GitHub Packages on: release: - types: ['published'] + types: [published] jobs: build: runs-on: ubuntu-latest @@ -163,7 +163,7 @@ If you use the Yarn package manager, you can install and publish packages using name: Publish Package to npmjs on: release: - types: ['published'] + types: [published] jobs: build: runs-on: ubuntu-latest From d9c3402b0a99044615f1179905e9d905abd2cc60 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Tue, 7 Feb 2023 15:27:45 +0000 Subject: [PATCH 3/3] Apply suggestions from code review --- .../actions/publishing-packages/publishing-nodejs-packages.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/actions/publishing-packages/publishing-nodejs-packages.md b/content/actions/publishing-packages/publishing-nodejs-packages.md index b9563a8a3f83..a2e56dc72e58 100644 --- a/content/actions/publishing-packages/publishing-nodejs-packages.md +++ b/content/actions/publishing-packages/publishing-nodejs-packages.md @@ -51,7 +51,7 @@ If you add steps in your workflow to configure the `publishConfig` fields in you ## Publishing packages to the npm registry -You can trigger a workflow to publish your NPM package every time you [publish a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release). The process in the following example is executed when the release event of type 'published' is triggered. If the CI tests pass, the process uploads the package to the npm registry. +You can trigger a workflow to publish your package every time you publish a new release. The process in the following example is executed when the release event of type `published` is triggered. If the CI tests pass, the process uploads the package to the npm registry. For more information, see "[Managing releases in a repository](/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release)." To perform authenticated operations against the npm registry in your workflow, you'll need to store your npm authentication token as a secret. For example, create a repository secret called `NPM_TOKEN`. For more information, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)." @@ -94,7 +94,7 @@ Please note that you need to set the `registry-url` to `https://registry.npmjs.o ## Publishing packages to {% data variables.product.prodname_registry %} -You can trigger a workflow to publish your NPM package every time you [publish a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release). The process in the following example is executed when the release event of type 'published' is triggered. If the CI tests pass, the process uploads the package to the npm registry. +You can trigger a workflow to publish your package every time you publish a new release. The process in the following example is executed when the release event of type `published` is triggered. If the CI tests pass, the process uploads the package to {% data variables.product.prodname_registry %}. For more information, see "[Managing releases in a repository](/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release)." ### Configuring the destination repository