generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 7
fix: Update postinstall scripts to check DEPENDABOT variable #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change environment variable check from GITHUB_ACTOR (GitHub Actions only) to DEPENDABOT (Dependabot updater environment) to properly skip postinstall scripts during dependency resolution. - playwright-install.sh: Check DEPENDABOT instead of GITHUB_ACTOR - rebuild-native.sh: Check DEPENDABOT instead of GITHUB_ACTOR - playwright-install.sh: Add secondary check for PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD This fixes Dependabot npm package updates which were failing because: 1. GITHUB_ACTOR is only available in GitHub Actions workflows 2. Dependabot's updater runs in a separate environment where GITHUB_ACTOR is not set 3. Without skipping, playwright-install.sh runs yarn playwright install, which tries to download browsers and fails, corrupting the yarn state Fixes the 'Couldn't find the node_modules state file' error in Dependabot updates. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sirtimid
previously approved these changes
Jan 27, 2026
Contributor
sirtimid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤞
The test job needs Playwright browsers for the streams package tests. The env var was set to skip browser download, but it should only apply to jobs that don't need browsers (lint, build, changelog, integration). This fixes the Playwright cleanup error in CI unit tests. Co-Authored-By: Claude <noreply@anthropic.com>
Install only the headless shell in CI (--only-shell) for faster downloads and smaller footprint. Keep full browser locally for debugging. Co-Authored-By: Claude <noreply@anthropic.com>
The --only-shell flag only installs the headless shell, but e2e tests need the full browser for launchPersistentContext with headless: false. Co-Authored-By: Claude <noreply@anthropic.com>
Unit tests only need the headless shell, which is smaller and faster. E2e tests need the full browser for launchPersistentContext. - Add PLAYWRIGHT_ONLY_SHELL=1 to test job - Script checks for this flag and uses --only-shell when set Co-Authored-By: Claude <noreply@anthropic.com>
Both scripts now check for DEPENDABOT (set in updater environment) OR GITHUB_ACTOR=dependabot[bot] (set in PR workflows) to properly skip in all Dependabot contexts. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Contributor
Coverage Report
File CoverageNo changed files found. |
sirtimid
approved these changes
Jan 27, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes CI failures caused by Playwright browser installation issues in different environments.
Problem
PR #743 attempted to skip Playwright browser downloads in Dependabot environments to avoid OOM failures. However, it had two issues:
GITHUB_ACTORcheck didn't work in the Dependabot updater environmentPLAYWRIGHT_SKIP_BROWSER_DOWNLOADcheck to the install script caused unit tests to fail because the test job actually needs Playwright browsers for the streams package testsSolution
DEPENDABOTenv var - The Dependabot updater sets this variable, making detection reliablePLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1for all jobs including tests. Now the test job doesn't set this flag, so browsers are installed. Other jobs (lint, build, changelog, integration) still skip browser download since they don't need them.--only-shell) for faster downloads and smaller footprint. Local development still gets the full browser for debugging.Changes
scripts/playwright-install.sh: Skip in Dependabot, respectPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD, use minimal browser in CIscripts/rebuild-native.sh: UseDEPENDABOTinstead ofGITHUB_ACTORcheck.github/workflows/lint-build-test.yml: RemovePLAYWRIGHT_SKIP_BROWSER_DOWNLOADfrom test job onlyNote
Aligns CI and install scripts to prevent Playwright-related failures while keeping tests functional.
scripts/playwright-install.sh: Skip in Dependabot viaDEPENDABOTorGITHUB_ACTOR; honorPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD; in CI install Chromium with--with-deps, using--only-shellwhenPLAYWRIGHT_ONLY_SHELL=1.github/workflows/lint-build-test.yml(test job): replacePLAYWRIGHT_SKIP_BROWSER_DOWNLOADwithPLAYWRIGHT_ONLY_SHELLso browsers install minimally during tests; other jobs still skip downloadsscripts/rebuild-native.sh: skip native rebuilds in Dependabot usingDEPENDABOTorGITHUB_ACTORWritten by Cursor Bugbot for commit 0769b3c. This will update automatically on new commits. Configure here.