fix(ci): unify npm auth strategy, add always-auth, better logging
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 15s
Build & Deploy / 🧪 QA (push) Failing after 1m34s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 15s
Build & Deploy / 🧪 QA (push) Failing after 1m34s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -163,13 +163,23 @@ jobs:
|
|||||||
TOKEN="${{ secrets.NPM_TOKEN }}"
|
TOKEN="${{ secrets.NPM_TOKEN }}"
|
||||||
if [ -z "$TOKEN" ]; then TOKEN="${{ secrets.MINTEL_PRIVATE_TOKEN }}"; fi
|
if [ -z "$TOKEN" ]; then TOKEN="${{ secrets.MINTEL_PRIVATE_TOKEN }}"; fi
|
||||||
if [ -z "$TOKEN" ]; then TOKEN="${{ secrets.GITEA_PAT }}"; fi
|
if [ -z "$TOKEN" ]; then TOKEN="${{ secrets.GITEA_PAT }}"; fi
|
||||||
if [ -z "$TOKEN" ]; then echo "Missing NPM_TOKEN secret! Add it to Gitea repo settings."; exit 1; fi
|
if [ -z "$TOKEN" ]; then echo "❌ Missing NPM_TOKEN / MINTEL_PRIVATE_TOKEN / GITEA_PAT secret!"; exit 1; fi
|
||||||
echo "@mintel:registry=https://${{ vars.REGISTRY_HOST || 'git.infra.mintel.me/api/packages/mmintel/npm/' }}" > .npmrc
|
|
||||||
echo "//${{ vars.REGISTRY_HOST || 'git.infra.mintel.me/api/packages/mmintel/npm/' }}:_authToken=${TOKEN}" >> .npmrc
|
# Mask token in logs (just in case, but Gitea usually does this automatically)
|
||||||
|
echo "::add-mask::$TOKEN"
|
||||||
|
|
||||||
|
echo "Configuring .npmrc for git.infra.mintel.me..."
|
||||||
|
echo "@mintel:registry=https://git.infra.mintel.me/api/packages/mmintel/npm/" > .npmrc
|
||||||
|
echo "//git.infra.mintel.me/api/packages/mmintel/npm/:_authToken=${TOKEN}" >> .npmrc
|
||||||
|
echo "always-auth=true" >> .npmrc
|
||||||
|
|
||||||
|
# Also export for pnpm to pick it up from env if needed
|
||||||
|
echo "NPM_TOKEN=${TOKEN}" >> $GITHUB_ENV
|
||||||
- name: 🏗️ Compile Sibling Monorepo
|
- name: 🏗️ Compile Sibling Monorepo
|
||||||
run: |
|
run: |
|
||||||
cp .npmrc _at-mintel/
|
cp .npmrc _at-mintel/
|
||||||
cd _at-mintel
|
cd _at-mintel
|
||||||
|
# Use local .npmrc or env token
|
||||||
pnpm install --no-frozen-lockfile
|
pnpm install --no-frozen-lockfile
|
||||||
pnpm build
|
pnpm build
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user