You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+20
Original file line number
Diff line number
Diff line change
@@ -247,5 +247,25 @@ steps:
247
247
# `npm rebuild` will run all those post-install scripts for us.
248
248
- run: npm rebuild && npm run prepare --if-present
249
249
```
250
+
### Yarn2 configuration
251
+
Yarn2 ignores both .npmrc and .yarnrc files created by the action, so before installing dependencies from the private repo it is necessary either to create or to modify existing yarnrc.yml file with `yarn config set` commands.
250
252
253
+
Below there's a sample "Setup .yarnrc.yml" step to configure private github registy for `my-org` organisation.
254
+
255
+
```yaml
256
+
steps:
257
+
- uses: actions/checkout@v3
258
+
- uses: actions/setup-node@v3
259
+
with:
260
+
node-version: '14.x'
261
+
- name: Setup .yarnrc.yml
262
+
run: |
263
+
yarn config set npmScopes.my-org.npmRegistryServer "https://npm.pkg.github.com"
264
+
yarn config set npmScopes.my-org.npmAlwaysAuth true
265
+
yarn config set npmScopes.my-org.npmAuthToken $NPM_AUTH_TOKEN
266
+
env:
267
+
NPM_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }}
268
+
- name: Install dependencies
269
+
run: yarn install --immutable
270
+
```
251
271
NOTE: As per https://github.com/actions/setup-node/issues/49 you cannot use `secrets.GITHUB_TOKEN` to access private GitHub Packages within the same organisation but in a different repository.
0 commit comments