Skip to content

Commit 08c6271

Browse files
authored
fix: sanitize deprecated npm_config env vars before deploy commands (#201)
## Problem npm 10+ (shipped with Node 20.17+, Node 22+, Node 24) emits deprecation warnings to stderr for legacy `npm_config_*` environment variables inherited from the GitHub Actions runner environment: ``` npm warn config This environment variable is no longer supported: npm_config_version_tag_prefix npm warn config This environment variable is no longer supported: npm_config_version_git_message npm warn config This environment variable is no longer supported: npm_config_version_commit_hooks ``` Jarvis treats **any stderr output** as a deployment failure, causing deploys to fail for repos that have upgraded to Node 24 (e.g. `results` via #2436). ## Root Cause These env vars are set by the runner environment (not by our workflows or `.npmrc`). They are remnants of npm v6-era config that npm 10+ no longer recognizes. ## Fix Unset the deprecated keys before running deploy commands in both: - `frontend-deploy-workflow.yml` (production deploy) - `frontend-pr-workflow.yml` (preview deploy) The `unset` is a no-op on older Node versions where these vars don't exist, so this is safe for all repos regardless of Node version.
1 parent 68dbb1f commit 08c6271

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/frontend-deploy-workflow.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,17 @@ jobs:
604604
output_credentials: true
605605

606606
- name: Deploy to production
607-
run: ${{ inputs.deploy-command }}
607+
run: |
608+
# Remove deprecated npm config env vars inherited from the runner environment.
609+
# npm 10+ (Node 20.17+/Node 22+) emits warnings to stderr for these legacy keys,
610+
# and Jarvis treats any stderr output as a deployment failure.
611+
# Using both UPPER and lower-case forms to cover all platforms.
612+
unset NPM_CONFIG_ARGV NPM_CONFIG_VERSION_TAG_PREFIX NPM_CONFIG_VERSION_GIT_MESSAGE \
613+
NPM_CONFIG_VERSION_COMMIT_HOOKS NPM_CONFIG__TYPEFORM_REGISTRY 2>/dev/null || true
614+
unset npm_config_argv npm_config_version_tag_prefix npm_config_version_git_message \
615+
npm_config_version_commit_hooks npm_config__typeform_registry 2>/dev/null || true
616+
617+
${{ inputs.deploy-command }}
608618
env:
609619
# Jarvis debug logging
610620
DEBUG: jarvis

.github/workflows/frontend-pr-workflow.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,16 @@ jobs:
520520
account: 'prod'
521521

522522
- name: Deploy preview
523-
run: ${{ inputs.deploy-command }}
523+
run: |
524+
# Remove deprecated npm config env vars inherited from the runner environment.
525+
# npm 10+ (Node 20.17+/Node 22+) emits warnings to stderr for these legacy keys,
526+
# and Jarvis treats any stderr output as a deployment failure.
527+
unset NPM_CONFIG_ARGV NPM_CONFIG_VERSION_TAG_PREFIX NPM_CONFIG_VERSION_GIT_MESSAGE \
528+
NPM_CONFIG_VERSION_COMMIT_HOOKS NPM_CONFIG__TYPEFORM_REGISTRY 2>/dev/null || true
529+
unset npm_config_argv npm_config_version_tag_prefix npm_config_version_git_message \
530+
npm_config_version_commit_hooks npm_config__typeform_registry 2>/dev/null || true
531+
532+
${{ inputs.deploy-command }}
524533
env:
525534
DEBUG: jarvis
526535
GH_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)