Skip to content

Commit 09f1bbc

Browse files
fix(repo): vercel deploy with GH_NPM_REGISTRY_TOKEN secret
1 parent 3dd2ec9 commit 09f1bbc

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/vercel-deploy.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,22 @@ jobs:
187187
ERROR_MSG=""
188188
DEPLOY_URL=""
189189
set +e # Don't exit on error
190-
DEPLOY_OUTPUT=$(vercel deploy --token $VERCEL_TOKEN --yes ${{ steps.vars.outputs.prod_flag }} 2>&1)
190+
DEPLOY_OUTPUT=$(vercel deploy --token "$VERCEL_TOKEN" --yes \
191+
--build-env GH_NPM_REGISTRY_TOKEN="$GH_NPM_REGISTRY_TOKEN" \
192+
${{ steps.vars.outputs.prod_flag }} 2>&1)
191193
DEPLOY_EXIT_CODE=$?
192194
set -e
193195
196+
# Defensive: redact known secrets from captured output before any
197+
# downstream consumer (step summary, PR comment, logs) sees it.
198+
# GH Actions masks secrets in live runner logs, but masking does not
199+
# extend to values we re-emit through outputs or external APIs.
200+
for __secret in "$GH_NPM_REGISTRY_TOKEN" "$VERCEL_TOKEN" "$VERCEL_ORG_ID"; do
201+
if [ -n "$__secret" ]; then
202+
DEPLOY_OUTPUT="${DEPLOY_OUTPUT//$__secret/***}"
203+
fi
204+
done
205+
194206
if [ $DEPLOY_EXIT_CODE -eq 0 ]; then
195207
# Extract or construct the deployment URL
196208
if [ "${{ steps.vars.outputs.prod_flag }}" == "--prod" ]; then
@@ -228,6 +240,7 @@ jobs:
228240
env:
229241
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
230242
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
243+
GH_NPM_REGISTRY_TOKEN: ${{ secrets.GH_NPM_REGISTRY_TOKEN }}
231244
CI: true
232245
NODE_ENV: production
233246

apps/apollo-docs/vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"buildCommand": "cd ../.. && pnpm turbo build --filter=apollo-docs",
3-
"installCommand": "cd ../.. && pnpm install",
3+
"installCommand": "cd ../.. && pnpm install --filter=apollo-docs...",
44
"framework": "nextjs",
55
"ignoreCommand": "git diff HEAD^ HEAD --quiet . && git diff HEAD^ HEAD --quiet ../../packages"
66
}

0 commit comments

Comments
 (0)