mirror of
https://github.com/actions/setup-go.git
synced 2026-04-05 12:19:24 +00:00
This fix addresses the issue where calling setup-go multiple times with
caching enabled in the same workflow would fail because the second
invocation attempted to save to the same cache key.
Changes:
- Add tracking of processed cache keys using state variables to prevent
duplicate cache save attempts
- Add helper functions in constants.ts for state management:
- getAlreadyCachedKey()/setAlreadyCachedKey(): Track keys already in cache
- getPrimaryCacheKey()/setPrimaryCacheKey(): Track the primary key for
each invocation
- getCachedGoModPath()/setCachedGoModPath(): Track which go.mod was cached
- Modify cache-restore.ts to store state about the cache operation
- Modify cache-save.ts to check if cache was already saved for this
go.mod path before attempting to save again
- Add comprehensive tests for the multiple invocation scenario
This enables workflows that need to setup Go with different configurations
(e.g., different working directories) multiple times without cache
conflicts.
Assisted-By: cagent
|
||
|---|---|---|
| .. | ||
| cache-save | ||
| setup | ||