Repository navigation
feat: cache Electron lifecycle downloads - #11
Merged
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
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
cache-electron: "true"support for the two lifecycle download caches Electron applications needelectron_config_cacheandnpm_config_cacheat fixed roots beneath the selected working directory before installelectron-true-v1Root cause
The package-manager dependency cache does not include downloads made by lifecycle scripts. In the motivating PwrAgent failure, pnpm restored its store and reused every package, but root postinstall still asked
prebuild-installto download the Electron-ABI better-sqlite3 binary and failed with a socket hang-up. Electron runtime downloads from@electron/getare separate for the same reason.Design
The input is deliberately named
cache-electroninstead of exposing arbitrary additional cache paths. The action has a concrete two-cache contract, can assign the matching environment variables itself, and does not give callers a footgun that could archive unrelated home-directory or self-hosted-runner data.When disabled (the default), the Electron paths and key segment are empty, so the evaluated cache paths and cache key remain unchanged. When enabled, the cache contains:
<working-directory>/.cache/configure-nodejs/npmfornpm_config_cache(including_prebuilds)<working-directory>/.cache/configure-nodejs/electronforelectron_config_cacheThe enabled key adds
electron-true-v1. The explicit mode and schema keep it separate from immutable pre-feature caches and provide a cold-key migration point if the contract changes.Consumer impact
After this action change lands, PwrAgent and PwrSnap should set
cache-electron: "true"on every matching lookup-only primer and downstream consumer. Each OS/architecture gate remains separate. No home-directory cache environment is needed; this action exports both workspace-local variables before lifecycle scripts run.This PR does not publish a release, create or move a tag, or update
v1.Validation
npm test— 89 passing testsgo run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 -colorgit diff --check