Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding go-version with latest regardless of settings #516

Open
2 of 5 tasks
ross-spencer opened this issue Nov 21, 2024 · 2 comments
Open
2 of 5 tasks

Overriding go-version with latest regardless of settings #516

ross-spencer opened this issue Nov 21, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ross-spencer
Copy link

Description:

I have the following configured:

    - name: Set up Go
      uses: actions/setup-go@v5
      with:
        go-version: '1.22'
    - run: go version

But in GitHub the workflow is always downloading 1.23.3:

Run actions/setup-go@v5
Setup go version spec 1.22
Found in cache @ /opt/hostedtoolcache/go/1.22.9/x64
Added go to the path
Successfully set up Go version 1.22
go: downloading go1.23.3 (linux/amd64)
/opt/hostedtoolcache/go/1.22.[9](https://github.com/ocfl-archive/error/actions/runs/11952824712/job/33319397499#step:4:10)/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.22.9/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Cache is not found
go version go1.23.3 linux/amd64

Action version:

V5.

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Expected 1.22 getting 1.23.3

Repro steps:

Currently running in this PR here: https://github.com/ocfl-archive/error/pull/1/files#diff-717013d02a8afac81852f25ba8ecd3cc0ca53a7f1fe25bedebfd66d6f518d21c

Expected behavior:
A description of what you expected to happen.

Configuration of Go version should work.

Actual behavior:
A description of what is actually happening.

It looks like Go 1.22 is successfully installed and then it is overridden by 1.23. It shows up quite profoundly in this workflow because staticcheck is not compiled for 1.23.

@ross-spencer ross-spencer added bug Something isn't working needs triage labels Nov 21, 2024
@ross-spencer
Copy link
Author

ross-spencer commented Nov 21, 2024

I've tried a few things including ignoring cache, the runner looks like this now:

Run actions/setup-go@v5
  with:
    go-version: 1.[2](https://github.com/ocfl-archive/error/actions/runs/11953409989/job/33321226432#step:4:2)2
    cache: false
    check-latest: false
    token: ***
Setup go version spec 1.22
Found in cache @ /opt/hostedtoolcache/go/1.22.9/x64
Added go to the path
Successfully set up Go version 1.22
go: downloading go1.2[3](https://github.com/ocfl-archive/error/actions/runs/11953409989/job/33321226432#step:4:3).3 (linux/amd64)
go version go1.23.3 linux/amd6[4](https://github.com/ocfl-archive/error/actions/runs/11953409989/job/33321226432#step:4:4)

go env

I wonder if it is being overridden by go.mod? (can that be explicitly ignored?)

EDIT: i'm sure i'm doing something stupid here, just can't figure out what.

@aparnajyothi-y
Copy link

Hello @ross-spencer, Thank you for creating this issue and we will look into it :)

@mahalakshmi-rekadi mahalakshmi-rekadi self-assigned this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants