feat: use go.mod when no version inputs specified - #660
Conversation
- Add unit tests for auto-detection behavior - Implement go.mod auto-detection in resolveVersionInput() - Explicit inputs still take precedence over auto-detection Related issue: actions#523
Related issue: actions#523
Resolve merge conflicts: - action.yml: combine auto-detect description with .go-version/.tool-versions support - versions.yml: keep auto-detect-go-mod job alongside new tool-versions/go-version jobs - README.md: keep auto-detect section, adopt main's link to advanced-usage docs - tests: keep auto-detect tests alongside new go-download-base-url tests
|
Hi @aparnajyothi-y @priyagupta108, As a user of this action, this would be a nice quality-of-life improvement — I find myself specifying I saw you both reviewed related changes in #705 and #673, so your feedback here would be really valuable. Happy to make any changes needed. Thank you! |
Follows the pattern from actions#724 where detailed usage docs live in docs/advanced-usage.md rather than README.md.
|
Hi @raeperd 👋, A few related concerns:
Since the opt-in( |
|
Thanks for the detailed review. Yes, I still think this is a useful and reasonable default. This PR uses the root Regarding the concerns:
For the common single-module case, using the root |
|
Thank you for the detailed response, @raeperd. Our primary concern remains that changing the default behavior introduces a silent breaking change. Workflows that currently have a root go.mod but do not specify a version input would automatically switch from the pre-installed Go to the version defined in go.mod. Given how widely this action is used, even a seemingly niche scenario can translate into a significant number of affected workflows. We'd also like to highlight that while the patch drift and download/cache behaviors are consistent with |
|
@priya-kinthali Thanks, that makes sense. Since the primary concern is backward compatibility rather than the proposed behavior itself, would you be open to considering this change for the next major release? The new default could then be clearly communicated in the release notes and migration guidance. |
Description:
This PR adds automatic go.mod detection when neither
go-versionnorgo-version-fileis specified. This simplifies workflows for Go projects that already have a go.mod file.Before:
After:
Related issue:
Closes #523
Check list: