Skip to content

Commit

Permalink
fix npm auth token for yarn 4 (#3897)
Browse files Browse the repository at this point in the history
This PR makes the following changes:

- Fixes issue where yarn wasn't getting an npm auth token when
publishing packages.
  • Loading branch information
sotojn authored Jan 10, 2025
1 parent 1332f86 commit e064a54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/publish-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ jobs:
- name: Install and build packages
run: yarn && yarn setup

- name: Verify npm authentication within yarn
env:
CI_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn npm whoami

- name: Publish to npm
env:
CI_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn ts-scripts publish -t latest npm

- name: Publish to docker
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/publish-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ jobs:
- name: Install and build packages
run: yarn && yarn setup

- name: Verify npm authentication within yarn
env:
CI_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn npm whoami

- name: Publish to npm
env:
CI_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn ts-scripts publish -t tag npm

docker-build-publish:
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.6.0.cjs

enableHardenedMode: false

npmAuthToken: "${CI_NPM_AUTH_TOKEN:-placeHolderToken}"

0 comments on commit e064a54

Please sign in to comment.