Provide an option to skip the Go SDK tool-cache write for ephemeral / parallel self-hosted runners

Open
#792 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, go, typescript
Domain
ci-cd, tooling

Research direction

Start in src/installer.ts around lines 360-366, where the downloaded Go SDK is added to the runner tool cache, and trace addExecutablesToToolCache and the existing action inputs. Add an opt-out path that puts the extracted Go directory directly on PATH, then verify that the SDK cache write is skipped when the new input is false.

Written by the indexing model from the issue text.

Description

feature request

Description:
actions/setup-go currently writes the downloaded Go SDK into the runner-local tool cache unconditionally:

// src/installer.ts:360-366
core.info('Adding to the cache ...');
const toolCacheDir = await addExecutablesToToolCache(
  extPath,
  info,
  arch,
  toolName
);

addExecutablesToToolCache falls back to @actions/tool-cache.cacheDir, which recursively copies the extracted Go tree into RUNNER_TOOL_CACHE.
The existing cache input only controls Go module dependency caching and does not affect this SDK tool-cache write. There is no user-facing option to skip the SDK copy.
Proposed improvement: add a new input that, when set to false, skips addExecutablesToToolCache and adds the extracted Go directory directly to PATH.

Justification:
On our self-hosted runner fleet, the tc.cacheDir step takes ~1.5 minutes for each job.

RUNNER_TOOL_CACHE is local to each runner machine. In a parallel workflow that fans out across many ephemeral self-hosted runners, every runner that does not already have the exact Go version pays the full download + cacheDir copy cost. Those writes are not shared between runners, so the SDK cache is effectively useless for first-time setups in a fleet and becomes pure overhead.

Pre-installing Go versions into the runner image avoids the problem, but it pushes maintenance burden onto users and defeats the purpose of using the action for version management.

actions/setup-python does not use tc.cacheDir for the Python SDK; it extracts the archive and runs the setup script directly from the temp directory. setup-go should offer a comparable escape hatch for environments where the SDK cache will not be reused.

Are you willing to submit a PR?

yes

Dominant language
TypeScript
Stars
1.8k
Forks
684
Avg merge
12d 23h
Merged PRs (30d)
3

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from actions/setup-go

All issues in actions/setup-go

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.