You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: add GOBIN to PATH even if a version isn't installed #49
Request: setup-go should always add GOBIN to PATH, even if it uses the default Go installed in the environment. This would mirror how it always sets up Go matchers.
changed the title [-]Feature request: always add GOBIN to PATH[/-][+]Feature request: add GOBIN to PATH even if a version isn't installed[/+]on Apr 3, 2020
The code is adding it to the path (it actually does your second line of add-path - even on windows). Note it does not set GOPATH as that's a < go 1.12 and pre go modules concept. If that's your use case, you can set.
It also doesn't set GOBIN (but go/bin is added to path). do we think it should?
@bryanmacfarlane I'm not sure how it works for you, because in your output there is the line Added go to the path, and the only place that line is printed is below and is wrapped in a if (versionSpec):
Activity
[-]Feature request: always add GOBIN to PATH[/-][+]Feature request: add GOBIN to PATH even if a version isn't installed[/+]fsilva3 commentedon May 11, 2020
@ydnar I tried now with new version (setup-go@v2), and apparently it's adding GOBIN to PATH, working well at my repository.
ydnar commentedon May 11, 2020
Did you specify
go-version?remorses commentedon Jun 6, 2020
I had the same issue, after running
go mod downloadthe packages bins are not in path, using version v2Edit: looks like go mod download does not put binaries in GOBIN
subins2000 commentedon Nov 8, 2020
Seems like using this one-liner
- uses: actions/setup-go@v2just for setting the env won't work outbryanmacfarlane commentedon Nov 9, 2020
@subins2000 adding that one liner (setup-go@v2) does add gobin to the path.
Just tried. Look at the path step in this run.
The second entry of the path in this example has
/home/runner/go/binaddedsubins2000 commentedon Nov 9, 2020
@bryanmacfarlane It didn't work for me on a Windows host and bash, so had to do :
The above is deprecated in the latest images. Using this now :
bryanmacfarlane commentedon Nov 9, 2020
I'll try it out on windows.
The code is adding it to the path (it actually does your second line of add-path - even on windows). Note it does not set GOPATH as that's a < go 1.12 and pre go modules concept. If that's your use case, you can set.
It also doesn't set GOBIN (but go/bin is added to path). do we think it should?
leighmcculloch commentedon Dec 3, 2020
In my builds this yml is not resulting in GOBIN being in the PATH. If I go get tools they install fine but aren't available on the PATH.
This is a snippet from my workflow:
This is what I see if I echo PATH:
leighmcculloch commentedon Dec 3, 2020
@bryanmacfarlane I'm not sure how it works for you, because in your output there is the line
Added go to the path, and the only place that line is printed is below and is wrapped in aif (versionSpec):setup-go/src/main.ts
Lines 23 to 31 in d0c5def
leighmcculloch commentedon Dec 4, 2020
I've opened a PR #89 that adds GOBIN to PATH regardless of whether a version is specified. I tested it on my own repo and it worked in both cases.
wip: testing a fix for actions/setup-go#49
wip: testing a fix for actions/setup-go#49
wip: testing a fix for actions/setup-go#49
set go-version explicitly to add GOBIN to PATH
Sergey-Murtazin commentedon Oct 19, 2021
Hi @ydnar ! Sorry for the late response!
Could you please clarify if the issue is still actual for you?
Thanks!
ydnar commentedon Oct 19, 2021
Honestly, I haven’t checked. All of our uses of
actions/setup-gospecifyversion: ^1now:leighmcculloch commentedon Nov 7, 2021
@Sergey-Murtazin PR with a fix is open at #89.
Seems it didn't
dmitry-shibanov commentedon Mar 16, 2023
Hello everyone. We added this logic in new major action version. For now I'm going to close the issue. If you have any concerns feel free to ping us.