Skip to content

Commit 22730d4

Browse files
Move npm auth config to .npmrc with env vars (#214)
* 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. * Downgrade uuid to v8.3.2 and simplify npm config Changed uuid dependency from v9.0.0 to v8.3.2 to match the version used by azure-pipelines-task-lib dependencies. Removed --loglevel=http flag from npm ci commands in CI workflows to use default logging.
1 parent 113d664 commit 22730d4

6 files changed

Lines changed: 25 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ 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}"
3327
- run: npm ci --ignore-scripts
3428
env:
3529
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}
@@ -55,12 +49,6 @@ 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}"
6452
- run: npm ci --ignore-scripts
6553
env:
6654
ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }}

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ 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}"
154152
npm ci --ignore-scripts
155153
npm run build
156154

.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

package-lock.json

Lines changed: 20 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"underscore": "^1.13.8",
6565
"picomatch": "^2.3.2",
6666
"brace-expansion": "^2.1.2",
67-
"uuid": "^9.0.0"
67+
"uuid": "^8.3.2"
6868
},
6969
"publishConfig": {
7070
"registry": "https://npm.pkg.github.com"

0 commit comments

Comments
 (0)