Update default Go module caching to use go.mod#705
Merged
HarithaVattikuti merged 3 commits intoactions:mainfrom Jan 26, 2026
Merged
Update default Go module caching to use go.mod#705HarithaVattikuti merged 3 commits intoactions:mainfrom
HarithaVattikuti merged 3 commits intoactions:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the default Go module caching strategy to use go.mod instead of go.sum as the cache key dependency file. This change aligns with the V6 release strategy for intelligent caching that incorporates toolchain directives from go.mod.
Changes:
- Updated default dependency file pattern from
go.sumtogo.modin package manager configuration - Renamed variables in cache-restore logic from
goSumFileExiststogoModFileExistsfor clarity - Updated action.yml description to clarify support for both
go.modandgo.sum - Added comprehensive test coverage for the new default behavior
- Updated documentation to explain the change and how to use
go.sumif needed
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/package-managers.ts | Changed default dependencyFilePattern from 'go.sum' to 'go.mod' |
| src/cache-restore.ts | Updated variable names from goSumFileExists to goModFileExists for consistency |
| action.yml | Updated cache-dependency-path description to clarify it accepts both go.mod and go.sum |
| tests/cache-utils.test.ts | Updated test expectations to use 'go.mod' as dependency file pattern |
| tests/cache-restore.test.ts | Refactored existing tests and added new test for go.mod default behavior |
| dist/setup/index.js | Compiled distribution file reflecting source changes |
| dist/cache-save/index.js | Compiled distribution file reflecting source changes |
| README.md | Added documentation explaining the new default and how to override it |
| package-lock.json | Updated qs dependency from 6.14.0 to 6.14.1 (routine update) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AlekSi
reviewed
Jan 14, 2026
Updated breaking changes section with enhanced formatting and clarified toolchain management details.
mahabaleshwars
approved these changes
Jan 21, 2026
aparnajyothi-y
approved these changes
Jan 21, 2026
HarithaVattikuti
approved these changes
Jan 26, 2026
2 tasks
MissingRoberto
added a commit
to grafana/grafana
that referenced
this pull request
Mar 11, 2026
Update the reusable setup-go action to use **/*.mod instead of **/*.sum for cache-dependency-path. go.sum is an append-only checksum log that only grows and never removes entries, making it a poor cache key — it causes unnecessary cache misses when entries are added but dependencies haven't actually changed. go.mod accurately represents the actual dependency graph and is the correct file for cache invalidation. This aligns with the upstream actions/setup-go v6 default change: actions/setup-go#705 Made-with: Cursor
1 task
MissingRoberto
added a commit
to grafana/grafana
that referenced
this pull request
Mar 11, 2026
Update the reusable setup-go action to use **/*.mod instead of **/*.sum for cache-dependency-path. go.sum is an append-only checksum log that only grows and never removes entries, making it a poor cache key — it causes unnecessary cache misses when entries are added but dependencies haven't actually changed. go.mod accurately represents the actual dependency graph and is the correct file for cache invalidation. This aligns with the upstream actions/setup-go v6 default change: actions/setup-go#705 Made-with: Cursor
This was referenced Mar 11, 2026
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.
Description:
This pull request updates the default Go module caching strategy in the action to use go.mod as the cache key.
Related issue:
#478
Check list: