Skip to content

Commit 833bdee

Browse files
authored
feat(TU-33149): Attempting to avoid polluting global .npmrc (#718)
1 parent 1b136d9 commit 833bdee

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,24 @@ jobs:
4343
- run: yarn build
4444
env:
4545
NODE_ENV: 'production'
46-
# Configure registry for GitHub Packages
46+
# Configure registry for GitHub Packages using local .npmrc to avoid npm global config corruption
4747
- run: rm ./.npmrc
48-
- run: npm config set '//npm.pkg.github.com/:_authToken' $GH_TOKEN
48+
- run: |
49+
cat > .npmrc << 'EOF'
50+
//npm.pkg.github.com/:_authToken=${GH_TOKEN}
51+
@typeform:registry=https://npm.pkg.github.com/
52+
EOF
4953
env:
5054
GH_TOKEN: ${{ secrets.GH_TOKEN }}
51-
- run: npm config set @typeform:registry https://npm.pkg.github.com/
5255
- run: yarn add -W @typeform/jarvis
5356
- run: git checkout HEAD -- package.json # do not save jarvis dependency to package.json because it is private (the file is committed by semantic-release to bump version)
54-
- run: npm config delete @typeform:registry
57+
# Create clean .npmrc with just auth token
58+
- run: |
59+
cat > .npmrc << 'EOF'
60+
//npm.pkg.github.com/:_authToken=${GH_TOKEN}
61+
EOF
62+
env:
63+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5564
5665
# authenticate to AWS
5766
- uses: aws-actions/configure-aws-credentials@v4

0 commit comments

Comments
 (0)