Skip to content

Commit c8511eb

Browse files
Move npm auth config to .npmrc with env vars
Centralize npm registry authentication by configuring auth tokens in .npmrc using environment variable substitution instead of manually setting npm config in CI/CD workflows. This simplifies the build pipeline and removes hardcoded auth steps while maintaining security through secrets management. Also added .claude and .vscode to .gitignore.
1 parent 113d664 commit c8511eb

4 files changed

Lines changed: 7 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ jobs:
2424
with:
2525
node-version: 22.11.0
2626
registry-url: https://npm.echohq.com/
27-
- name: Configure echohq auth (both hosts)
28-
env:
29-
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}
30-
run: |
31-
npm config set //npm.echohq.com/:_authToken "${ECHO_LIBRARIES_ACCESS_KEY}"
32-
npm config set //packages.echohq.com/:_authToken "${ECHO_LIBRARIES_ACCESS_KEY}"
33-
- run: npm ci --ignore-scripts
27+
- run: npm ci --ignore-scripts --loglevel=http
3428
env:
3529
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}
3630
- name: Run Unit Tests
@@ -55,13 +49,7 @@ jobs:
5549
with:
5650
node-version: 22.11.0
5751
registry-url: https://npm.echohq.com/
58-
- name: Configure echohq auth (both hosts)
59-
env:
60-
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}
61-
run: |
62-
npm config set //npm.echohq.com/:_authToken "${ECHO_LIBRARIES_ACCESS_KEY}"
63-
npm config set //packages.echohq.com/:_authToken "${ECHO_LIBRARIES_ACCESS_KEY}"
64-
- run: npm ci --ignore-scripts
52+
- run: npm ci --ignore-scripts --loglevel=http
6553
env:
6654
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}
6755
- name: Code Linting

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ jobs:
149149
env:
150150
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}
151151
run: |
152-
npm config set //npm.echohq.com/:_authToken "${ECHO_LIBRARIES_ACCESS_KEY}"
153-
npm config set //packages.echohq.com/:_authToken "${ECHO_LIBRARIES_ACCESS_KEY}"
154-
npm ci --ignore-scripts
152+
npm ci --ignore-scripts --loglevel=http
155153
npm run build
156154
157155
- name: Create Pull Request

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dist
55
.DS_Store
66
.npmrc
77
.idea
8+
/.claude
9+
/.vscode

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Default registry for most packages
22
registry=https://npm.echohq.com/
3-
//packages.echohq.com/:_authToken=
3+
//npm.echohq.com/:_authToken=${ECHO_LIBRARIES_ACCESS_KEY}
4+
//packages.echohq.com/:_authToken=${ECHO_LIBRARIES_ACCESS_KEY}
45
always-auth=true
56
ignore-scripts=true

0 commit comments

Comments
 (0)