Use local Go cache on self-hosted Linux - #1273
Merged
Merged
Conversation
Self-hosted Linux jobs already receive machine-local module and build cache paths. Letting setup-go restore its archive into those live directories can collide with concurrent jobs and fail on existing files.\n\nDisable setup-go's remote cache layer only on self-hosted Linux. GitHub-hosted jobs and native jobs on other operating systems retain their existing cache behavior. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
ARC jobs did not expose runner.environment when setup-go inputs were evaluated, so the first condition incorrectly enabled archive caching on managed Linux and still extracted into the live local cache.\n\nUse the same repository and event identities that select trusted runner admission. Same-repository PRs and main pushes now reliably use only the machine-local cache, while external fork jobs retain hosted cache behavior. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
The managed-cache exception is specific to Linux runners with host-mounted Go cache paths. Keep setup-go's archive caching enabled on macOS and Windows while the repository/event predicate continues to distinguish trusted Linux routes from hosted fork jobs. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
The desktop artifact composite action owns a separate setup-go invocation, so changing only the top-level workflows left its managed Linux jobs restoring archives into the shared local cache.\n\nApply the same repository, event, and operating-system predicate inside the composite action. Trusted Linux builds use the machine-local cache while hosted fork and native platform builds retain setup-go caching. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
The runner context is not populated reliably when setup action inputs are evaluated on ARC jobs. Mirror runs-on routing with GitHub and matrix inputs so managed Linux keeps its host-local cache while hosted and native jobs retain setup-go caching. Generated with Codex Co-Authored-By: Codex <codex@openai.com>
roborev: Combined Review (
|
Composite action inputs are strings, and GitHub omitted a boolean false value at the action boundary. Pass literal true and false strings so setup-go receives a valid cache mode on every desktop platform. Generated with Codex Co-Authored-By: Codex <codex@openai.com>
roborev: Combined Review (
|
GitHub omits a false boolean expression at the action input boundary, causing setup-go to fall back to cache=true. Return literal false and true strings so managed Linux never archives its shared host cache while hosted jobs keep Actions caching. Generated with Codex Co-Authored-By: Codex <codex@openai.com>
PR validation invokes the main-pinned reusable workflow, which cannot pass a new action input introduced by the PR. Derive the managed Linux x64 cache mode from the composite action's existing bundle and target inputs so both the pinned caller and future main caller work. Generated with Codex Co-Authored-By: Codex <codex@openai.com>
roborev: Combined Review (
|
A main branch ref is not sufficient evidence of a trusted push because pull_request_target events expose the base branch ref. Bind the canonical main path to push events so only same-repository pull requests and main pushes select the managed runner and its local-cache mode. Generated with Codex Co-Authored-By: Codex <codex@openai.com>
roborev: Combined Review (
|
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.
Managed Linux jobs pass setup-go the literal cache value false using the same pre-dispatch repository and matrix facts that select the managed runner. They continue using the runner-provided GOMODCACHE and GOCACHE directories, so module and build caches remain local to each machine without archive restore or upload collisions.
Hosted fork builds and non-Linux jobs receive the literal value true and keep GitHub Actions caching. The main-pinned reusable workflow boundary remains unchanged.
The canonical-main routing arm now requires an explicit push event because pull_request_target also exposes the base branch ref. Only main pushes and same-repository pull requests can select the managed runner.