I have no idea what I’ve done (apart form updating to the latest release and extended), but when I try to run the github actions to deploy the hugo site to pages I get this error in github actions, under the Build Hugo section.
Run hugo \
go: errors parsing go.mod:
/home/runner/work/rodders99.github.io/rodders99.github.io/go.mod:3: invalid go version '1.22.0': must match format 1.23
Total in 34 ms
Error: failed to load modules: failed to download modules: failed to execute 'go [mod download -modcacherw]': failed to execute binary "go" with args [mod download -modcacherw]: go: errors parsing go.mod:
/home/runner/work/rodders99.github.io/rodders99.github.io/go.mod:3: invalid go version '1.22.0': must match format 1.23
*errors.errorString
Error: Process completed with exit code 1.
Go version 1.22.0
Hugo Extended : I’ve tried various version from 0.9 to 1.23. Previous .9 version was not extended.
My google foo is poor today because I can’t find the answer.
hugo: downloading modules …
go: errors parsing go.mod:
/home/runner/work/rodders99.github.io/rodders99.github.io/go.mod:3: invalid go version '1.22.0': must match format 1.23
hugo: collected modules in 2235 ms
Total in 2236 ms
Error: failed to load modules: failed to download modules: failed to execute 'go [mod download -modcacherw]': failed to execute binary "go" with args [mod download -modcacherw]: go: errors parsing go.mod:
/home/runner/work/rodders99.github.io/rodders99.github.io/go.mod:3: invalid go version '1.22.0': must match format 1.23
*errors.errorString
Error: Process completed with exit code 1.
I encountered this issue in the past, comment on this topic may helps.
go.mod:3: invalid go version ‘1.22.0’: must match format 1.23
must match format 1.23 is equals to must match format x.y, the message doesn’t require a specific version. Remove the extra parts from go directive from go.mod should work, i.e. go x.y.z to go x.y.
And it’s broken again, I only added under /content, no other files were changed. Now getting this error:
hugo: downloading modules …
go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available
hugo: collected modules in 4361 ms
Total in 4363 ms
Error: failed to load modules: failed to download modules: failed to execute 'go [mod download -modcacherw]': failed to execute binary "go" with args [mod download -modcacherw]: go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available
*errors.errorString
Error: Process completed with exit code 1.