GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `check-latest` doesn't work for `go.mod` file with patch version in `go` line · Issue #713 · actions/setup-go

check-latest doesn't work for go.mod file with patch version in go line #713

New issue
Copy link
New issue
Copy link
Closed
Closed
check-latest doesn't work for go.mod file with patch version in go line#713
Copy link
Assignees
v-priya-kinthali
Labels
bugSomething isn't working

Description

@DmitriyLewen
DmitriyLewen
opened on Feb 2, 2026
Issue body actions

Description:
When the go.mod file uses a patch version in the go line, setup-go installs this version even when the check-latest option is used.
However, the go line only indicates the minimum Go version required for the project.
You can see our tests here - aquasecurity/trivy#7163 (comment)

Action version:
tested with:

  • 4dc6199 # v6.1.0
  • 7a3fe6c # v6.2.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
go 1.25.4 from go.mod file.

Repro steps:

  1. Set go path version in go.mod file
  2. Use the following options:
    2.1. go-version-file: go.mod
    2.2. check-latest: true

You can see test run in my test repo - https://github.com/DmitriyLewen/test-setup-go-flags/actions/runs/21582509578/job/62182731321

Expected behavior:
setup latest go version (1.25.6 now).

Actual behavior:
1.25.4 version has been installed

Activity

  1. DmitriyLewen
    added
    bugSomething isn't working
    needs triage
    on Feb 2, 2026
  2. v-mahabaleshwars
    removed
    needs triage
    on Feb 3, 2026
  3. v-mahabaleshwars commented on Feb 3, 2026

    @v-mahabaleshwars
    v-mahabaleshwars
    on Feb 3, 2026
    Contributor
    More actions

    Hi @DmitriyLewen,
    Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.

    Reacted by DmitriyLewen
  4. v-priya-kinthali
    self-assigned this
    on Feb 3, 2026
  5. DmitriyLewen commented on Feb 3, 2026

    @DmitriyLewen
    DmitriyLewen
    on Feb 3, 2026
    Author
    More actions

    I investigated yerstarday a bit.
    Feel free to ignore my thought.

    It looks like problem with _findMatch() function.
    versionSpec is patch version (1.25.4 for this case). So this function finds only this version from candidates.

    IIUC you can trim patch version when check-latest option is used:

    setup-go/src/installer.ts

    Lines 76 to 91 in a5f9b05

    if (checkLatest) {
    core.info('Attempting to resolve the latest version from the manifest...');
    const resolvedVersion = await resolveVersionFromManifest(
    versionSpec,
    true,
    auth,
    arch,
    manifest
    );
    if (resolvedVersion) {
    versionSpec = resolvedVersion;
    core.info(`Resolved as '${versionSpec}'`);
    } else {
    core.info(`Failed to resolve version ${versionSpec} from manifest`);
    }
    }

  6. v-priya-kinthali commented on Feb 5, 2026

    @v-priya-kinthali
    v-priya-kinthali
    on Feb 5, 2026
    Contributor
    More actions

    Hello @DmitriyLewen👋,
    Thanks for the detailed report and for sharing the repro steps!
    As per the current design in the setup-go repository, when the go-version or go-version-file input is provided in major.minor format, and check-latest is set to true, the action first checks whether the cached version is the latest available. If the cached version is not up to date, it resolves the latest version by pulling from the main branch of the go-versions repository, and if needed it falls back to downloading directly from go.dev, as described in the actions/setup-go version resolution behaviour.
    However, when a specific patch version is provided (for example 1.25.4), the action treats it as a pinned version and will install exactly that patch version, even if a newer patch release exists.
    To have the action automatically pick up the latest patch release, please provide the version in major.minor format (for example 1.25) when using check-latest.
    Hope this helps clarify the current behaviour. Thank you again!

  7. DmitriyLewen commented on Feb 5, 2026

    @DmitriyLewen
    DmitriyLewen
    on Feb 5, 2026
    Author
    More actions

    Hello @priya-kinthali
    Thanks for your answer!

    Unfortunately, we can't set a major.minor version because Go sets the patch version from one of the child dependencies...

    However, the behaviour for Go and setup-go is different (because the version from the go line in the go.mod file is the minimal required version) - perhaps it makes sense to add information in README.md that the check-latest flag doesn't work for major.minor.patch versions.

  8. v-priya-kinthali commented on Mar 2, 2026

    @v-priya-kinthali
    v-priya-kinthali
    on Mar 2, 2026
    Contributor
    More actions

    Hello @DmitriyLewen👋,
    Thank you for your feedback on this! We've updated our documentation in PR#724 to clarify this behaviour. The Check latest version section in our advanced usage guide now notes that check-latest supports major (e.g., "1") and major.minor (e.g., "1.25") version selectors, always resolving to the latest matching patch release.
    We hope this helps clarify the expected behaviour. We'll go ahead and close this issue, but please don't hesitate to reopen if you have any further questions or concerns. Thanks again!

    Reacted by DmitriyLewen
  9. v-priya-kinthali
    closed this as completedon Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @v-priya-kinthali
    v-priya-kinthali

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.