Skip to content

Commit f9d0110

Browse files
authored
Adds a step to configure the publish scope. (#7299)
1 parent c936a98 commit f9d0110

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

content/packages/quickstart.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,31 @@ In this guide, you'll create a {% data variables.product.prodname_actions %} wor
8787
env:
8888
NODE_AUTH_TOKEN: ${% raw %}{{secrets.GITHUB_TOKEN}}{% endraw %}
8989
```
90-
8. Commit and push your changes to {% data variables.product.prodname_dotcom %}.
90+
8. Tell NPM which scope and registry to publish packages to using one of the following methods:
91+
- Add an NPM configuration file for the repository by creating a `.npmrc` file, in the root directory with the contents:
92+
{% raw %}
93+
```shell
94+
<em>@YOUR-USERNAME</em>:registry=https://npm.pkg.github.com
95+
```
96+
{% endraw %}
97+
- Edit the `package.json` file and specify the `publishConfig` key:
98+
{% raw %}
99+
```shell
100+
"publishConfig": {
101+
"@<em>YOUR-USERNAME</em>:registry": "https://npm.pkg.github.com"
102+
}
103+
```
104+
{% endraw %}
105+
106+
9. Commit and push your changes to {% data variables.product.prodname_dotcom %}.
91107
```shell
92108
$ git add .github/workflows/release-package.yml
109+
# Also add the file you created or edited in the previous step.
110+
$ git add <em>.npmrc or package.json</em>
93111
$ git commit -m "workflow to publish package"
94112
$ git push
95113
```
96-
9. The workflow that you created will run whenever a new release is created in your repository. If the tests pass, then the package will be published to {% data variables.product.prodname_registry %}.
114+
10. The workflow that you created will run whenever a new release is created in your repository. If the tests pass, then the package will be published to {% data variables.product.prodname_registry %}.
97115

98116
To test this out, navigate to the **Code** tab in your repository and create a new release. For more information, see "[Managing releases in a repository](/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release)."
99117

0 commit comments

Comments
 (0)