Skip to content

Conversation

@raeperd
Copy link

@raeperd raeperd commented Oct 12, 2025

Description:

This PR adds automatic go.mod detection when neither go-version nor go-version-file is specified. This simplifies workflows for Go projects that already have a go.mod file.

Before:

steps:
  - uses: actions/checkout@v5
  - uses: actions/setup-go@v6
    with:
      go-version-file: go.mod
  - run: go version

After:

steps:
  - uses: actions/checkout@v5
  - uses: actions/setup-go@v6
    # Automatically detects and uses go.mod from repository root
  - run: go version

Related issue:
Closes #523

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

- 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
@raeperd raeperd requested a review from a team as a code owner October 12, 2025 08:59
@raeperd raeperd changed the title feat: auto-detect go.mod when no version inputs specified feat: use go.mod when no version inputs specified Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make go-version-file: go.mod the default

1 participant