We have GitHubActions and we run it in an Centos Server. We have set the root's .bashrc as export GOROOT=/opt/go export PATH=$PATH:$GOROOT/bin
In the Github Actions we have the file:
setup:
needs: cleanup
name: Setup
runs-on: [self-hosted, Linux, X64, CentOS-Linux-7.9]
services:
postgres:
image: postgres:latest
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
# id: Go
- run: go version
- name: Checkout code into go module directory
uses: actions/checkout@v2
When Github Actions runs this , it throws the error:
0s
Run actions/setup-go@v2
with:
go-version: 1.17
stable: true
token: ***
...
Setup go stable version spec 1.17
Found in cache @ /opt/actions-runner/_work/_tool/go/1.17.11/x64
Added go to the path
missing $GOPATH
Error: Command failed: go env GOPATH
missing $GOPATH
Can someone please help with this error?
The Go installation is working and on the Linux box as root 'go version' works.