Skip to content

Conversation

jeffmendoza
Copy link
Member

Use default setup-go action settings that will pull from go mod
I'll mess with cloud build later (will remove the build there).

Signed-off-by: Jeff Mendoza <[email protected]>
@jeffmendoza jeffmendoza requested a review from a team as a code owner April 30, 2025 21:48
Copy link
Member

@spencerschrock spencerschrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use default setup-go action settings that will pull from go mod

I don't think that happens by default.
actions/setup-go#523

go.mod Outdated
go 1.23.0
go 1.24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.24.0?

1.24 assumes a .0and works with current tooling but I remember the initial tooling in Go 1.21 or 1.22 throwing errors at this format.

Comment on lines 11 to 12
with:
go-version: '1.21'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's also a stable alias if that helps.

@jeffmendoza jeffmendoza mentioned this pull request May 15, 2025
Signed-off-by: Stephen Augustus <[email protected]>
This instructs action/setup-go to pull the Golang version from
go.mod. This should make future upgrades more predictable than using
`go-version: stable`.

ref: https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file

Signed-off-by: Stephen Augustus <[email protected]>
Copy link
Member

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jeffmendoza and @spencerschrock!

I stacked two commits on top:

  • 7242a07 — drops toolchain directive, which can cause problems for consumers
  • f6550e4 — uses go.mod to determine the version for actions/setup-go

Here's an actions/setup-go snippet from a successful run:

Run actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
  with:
    go-version-file: go.mod
    check-latest: false
    token: ***
    cache: true
Setup go version spec 1.24
Attempting to download 1.24...
matching 1.24...
Acquiring 1.24.3 from https://github.com/actions/go-versions/releases/download/1.24.3-14875263452/go-1.24.3-linux-x64.tar.gz
Extracting Go...
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/8390be88-c2cc-4c44-82b3-155163c7b452 -f /home/runner/work/_temp/9102d775-9e54-4898-a9ad-7a0a519c81f0
Successfully extracted go to /home/runner/work/_temp/8390be88-c2cc-4c44-82b3-155163c7b452
Adding to the cache ...
Successfully cached go to /opt/hostedtoolcache/go/1.24.3/x64
Added go to the path
Successfully set up Go version 1.24
/opt/hostedtoolcache/go/1.24.3/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.24.3/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Cache is not found
go version go1.24.3 linux/amd64

@justaugustus justaugustus merged commit 86a08d6 into ossf:main May 17, 2025
7 checks passed
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.

3 participants