Commit Graph

53 Commits

Author SHA1 Message Date
1d76b952eb Improve toolchain handling (#460)
Some checks failed
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Has been cancelled
* Configure environment to avoid toolchain installs

Force `go` to always use the local toolchain (i.e. the one the one that
shipped with the go command being run) via setting the `GOTOOLCHAIN`
environment variable to `local`[1]:

> When GOTOOLCHAIN is set to local, the go command always runs the
bundled Go toolchain.

This is how things are setup in the official Docker images (e.g.[2], see
also the discussion around that change[3]). The motivation behind this
is to:

* Reduce duplicate work: if the `toolchain` version in `go.mod` was
  greated than the `go` version, the version from the `go` directive
  would be installed, then Go would detect the `toolchain` version and
  additionally install that
* Avoid Unexpected behaviour: if you specify this action runs with some Go
  version (e.g. `1.21.0`) but your go.mod contains a `toolchain` or `go`
  directive for a newer version (e.g. `1.22.0`) then, without any other
  configuration/environment setup, any go commands will be run using go
  `1.22.0`

This will be a **breaking change** for some workflows. Given a `go.mod`
like:

    module proj

    go 1.22.0

Then running any `go` command, e.g. `go mod tidy`, in an environment
where only go versions before `1.22.0` were installed would previously
trigger a toolchain download of Go `1.22.0` and that version being used
to execute the command. With this change the above would error out with
something like:

> go: go.mod requires go >= 1.22.0 (running go 1.21.7;
GOTOOLCHAIN=local)

[1] https://go.dev/doc/toolchain#select
[2] dae3405a32/Dockerfile-linux.template (L163)
[3] https://github.com/docker-library/golang/issues/472

* Prefer installing version from `toolchain` directive

Prefer this over the version from the `go` directive. Per the docs[1]

> The toolchain line declares a suggested toolchain to use with the
module or workspace

It seems reasonable to use this, since running this action in a
directory containing a `go.mod` (or `go.work`) suggests the user is
wishing to work _with the module or workspace_.

Link: https://go.dev/doc/toolchain#config [1]
Issue: https://github.com/actions/setup-go/issues/457

* squash! Configure environment to avoid toolchain installs

Only modify env if `GOTOOLCHAIN` is not set

* squash! Prefer installing version from `toolchain` directive

Avoid installing from `toolchain` if `GOTOOLCHAIN` is `local`, also
better regex for matching toolchain directive
2025-08-28 22:21:56 -05:00
3d10edb4c2 Add new permission section (#533)
Some checks failed
CodeQL analysis / CodeQL analysis (push) Failing after 2s
Licensed / Licensed (push) Failing after 3s
2025-01-16 08:47:07 -06:00
3041bf56c9 feat: fallback to "raw" endpoint for manifest when rate limit is reached (#496)
Some checks failed
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Has been cancelled
Validate Windows installation / Find default go version (push) Has been cancelled
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Has been cancelled
* feat: fallback to "raw" endpoint for manifest when rate limit is reached

* add information about raw access to the README

* prettier

* update cross-spawn to 7.0.6 to fix vulnerability
2024-11-25 12:37:21 -06:00
cdcb360436 Remove the description of the old go.mod specification (#458)
* Fix emoji rendering

* Fix quoting

* Remove the description of the old go.mod specification

* Remove the single quotes from `go-version-file`

* Fix README

* Add description about patch versions to README

* Revert "Remove the single quotes from `go-version-file`"

This reverts commit ca4321abee.
2024-04-18 08:33:57 -05:00
99176a8f9a Update README.md with V5 release notes (#459) 2024-04-15 09:19:11 -05:00
6c1fd22b67 docs: bump actions/setup-go to v5 (#449)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-01-29 10:18:45 -06:00
3d65fa57fc feat: bump to use actions/checkout@v4
Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-09-05 11:42:39 -04:00
d45ebba0ce Rephrase sentence
Co-authored-by: Ivan <98037481+IvanZosimov@users.noreply.github.com>
2023-08-29 15:43:02 +02:00
317c6617fa Replace wildcards term with globs. 2023-08-28 12:47:43 +02:00
8018234347 Improve documentation regarding dependencies cachin 2023-08-25 12:31:19 +02:00
992f068900 Add note about YAML parsing versions (#382) 2023-06-08 15:37:31 +02:00
0e6baa5a93 Added a description that go-version should be specified as a string type (#367) 2023-06-05 13:06:05 +02:00
8dbf352f06 update README fo v4 (#354) 2023-03-15 15:27:29 +01:00
c51a720768 Enable caching by default with default input (#332) 2023-03-10 16:25:35 +01:00
807559307d Use const declarations for variables that are never reassigned (#322) 2023-01-31 11:46:49 +01:00
9c64203f1d Update basic validation badge 2022-12-23 12:03:14 +09:00
38dbe75f81 Add stable and oldstable aliases (#300) 2022-12-12 10:58:49 +01:00
e983b65a44 Merge pull request #283 from koba1t/add_support_gowork_for_go-version-file
add support go.work file for go-version-file
2022-11-08 11:45:09 +01:00
27b43e1b0d Pass the token input through on GHES (#277) 2022-11-02 12:21:18 +01:00
7678c83214 add support gowork for go-version-file 2022-11-01 21:25:30 +09:00
e68a999c97 Fix broken code of conduct link (#260) 2022-09-05 12:39:44 +02:00
b22fbbc292 Implementation of caching functionality for setup-go action (#228) 2022-05-25 12:07:29 +02:00
265edc1beb Add go-version-file option (#62) 2022-05-12 10:04:39 +02:00
3332358454 Add note about go building 2022-04-20 16:11:14 +02:00
bf7ccf173e Correct some small README.md formatting typos (#213) 2022-04-01 09:27:16 -04:00
dcb4ec94ce Bump GitHub actions, README.md cleanups (#202)
* Bump `actions/checkout@v3`

* Bump `actions/setup-node@v3`

* Bump `actions/upload-artifact@v3`

* Bump `actions/setup-go@v3` in `README.md` examples

* Removed mention of `stable` action argument from `README.md`

* Add "new style" workflow build buttons to `README.md`
2022-03-31 15:29:52 -04:00
341b20ac36 Update usage examples on readme (#212)
* Fix action usage examples on readme

* Revert changes on package-lock

* Fix some checkout action version
2022-03-29 15:16:03 -04:00
acdbc5377c Remove stable input description from README 2022-03-28 10:24:34 +02:00
3e6475c089 Update README to v3 2022-03-25 09:53:28 +01:00
bfdd3570ce Implement "check-latest" flag to check if pre-cached version is latest one (#186) 2022-02-09 14:59:04 +03:00
44e221478f Replace 'ubuntu-16.04' -> 'ubuntu-latest' (#180) 2022-01-12 09:40:09 +03:00
3e9d5483e6 Add semver note to documentation (#164) 2021-12-01 14:10:32 +03:00
02f7ea9f09 Fix yaml indent (#59) 2021-11-08 13:28:08 +03:00
6eb700292f Reference latest setup-go 2020-11-27 08:11:50 +01:00
8e98458ff1 updating matrix in readme 2020-07-22 07:52:29 -04:00
d0c5defdf3 Switch manifest installation from "master" to "main" branch (#65)
* switch from master to main branch

* Update README.md
2020-07-20 12:50:40 -04:00
0f551ac199 Update v2 tags in readme 2020-04-16 18:52:49 -04:00
e1c0a1665b Update readme with v2 release 2020-04-16 18:52:17 -04:00
768458bd0b pre-release version and test 2020-02-10 19:18:01 -05:00
7af81a4a65 bit of cleanup 2020-02-09 14:39:34 -05:00
4282769cc0 starting v2 and proxy support 2020-02-09 00:21:39 -05:00
632d18fc92 Handle .x version syntax with latest release (#13)
* get latest release for .x syntax version

* added nock as dev dependency

* added test for .x syntax

* updated readme

* updated http client name

* use rest client for getting available versions

* more .x handling

* move nock to setup and teardown
2019-08-19 08:28:37 -04:00
5064ef8f2b Use correct comment character 2019-08-16 10:21:05 -04:00
818723587f Update to use go-version (#10) 2019-08-13 16:31:11 -04:00
b98503c960 Add badge 2019-08-12 15:13:31 -04:00
419ae75c25 Quoting 2019-08-01 11:05:15 -04:00
58fca98f91 v1 (#8) 2019-08-01 09:19:30 -04:00
fb0fde1081 actions to steps 2019-07-25 21:28:46 -04:00
a7fe89aa82 Update README.md 2019-07-23 15:46:37 -04:00
706cf65fdf Add checkout 2019-07-23 15:15:32 -04:00