Skip to content

feat: Utilize the.tool-versions file to set expected Go version #375

Closed

Description

@plukevdh

Description:
It would be useful to utilize the .tool-versions file to set the expect version of Go for the action runtime in addition to being able to set via the parameters.

Justification:
Because an action may be used across a variety of steps, it can be burdensome to track the Go version via the parameter in every place used. Several other setup-<lang> projects are also utilizing or making progress towards using the .tool-versions file for version locking.

Are you willing to submit a PR?
💯 if this feels like a thing that would be useful to the community and in keeping with the goal of this project.

Activity

  1. IvanZosimov commented on May 22, 2023

    @IvanZosimov
    Contributor

    Hi, @plukevdh 👋 Thanks for the feature request, we will take a look and get back to you with updates.

  2. plukevdh commented on May 22, 2023

    @plukevdh
    Author

    @IvanZosimov thanks! Note that I also opened a PR for this feature as well with some initial ideas: #376

  3. steebchen commented on May 30, 2023

    @steebchen

    This would be awesome to have, the setup-node action also supports this 👍

    - uses: actions/setup-node@v3
      with:
        # ...
        # File containing the version Spec of the version to use.  Examples: .nvmrc, .node-version, .tool-versions.
        # If node-version and node-version-file are both provided the action will use version from node-version. 
        node-version-file: ''
    

    https://github.com/actions/setup-node#usage

  4. self-assigned this
    on Jul 27, 2023
  5. linked a pull request that will close this issuedocs: go-version-file for other use cases #295on Aug 15, 2023
  6. dsame commented on Aug 16, 2023

    @dsame
    Contributor

    Hello @plukevdh , thank you for your contribution, but i would ask you to review this PR as well #402 - do you see any drawbacks of using the existing go-version-file input instead of introducing new one tool-versions-file https://github.com/actions/setup-go/pull/376/files#diff-b97cd7a3fa566070832c220ba3fab8e4f60694550f6fe74d6024a20486165de8R148 ?

  7. plukevdh commented on Aug 16, 2023

    @plukevdh
    Author

    @dsame Happy to close this in favor of #402 since it's a simpler solve.

  8. dsame commented on Aug 17, 2023

    @dsame
    Contributor

    Hello @plukevdh , thank you for assistance to make a choice between #402 and #376, but i'll keep this issue open till #402 will have been merged

  9. reopened this on Aug 17, 2023
  10. v-priya-kinthali commented on Oct 24, 2025

    @v-priya-kinthali
    Contributor

    Hello @plukevdh👋,
    We have opened PR#673, which adds support for the .tool-versions file. Your feedback and review would be greatly appreciated. Thanks in advance!

  11. v-priya-kinthali commented on Oct 30, 2025

    @v-priya-kinthali
    Contributor

    Hello👋,
    We’re happy to inform you that PR #673, which adds support for the .tool-versions file, has been merged!
    To utilize this feature, you can use the actions/setup-go@main branch in your workflows for now, and the changes will be reflected in the upcoming releases.
    We’ll be closing this issue. Please feel free to reach out if you have any further questions or need additional assistance.
    Thanks again for your suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature requestNew feature or request to improve the current logic

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions