I wrote a GitHub Action which uses the Golang base image to install some additional tooling. I have a workflow like this:
jobs: test: runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@v2 with: go-version: 1.14 - name: Checkout code uses: actions/checkout@v2 - name: Test run: go test -tags sqlite -failfast ./... # This is my own Docker-based action: - name: Build release snapshot uses: firstname.lastname@example.org with: run: release/snapshot
ory/actions action fails because GitHub Actions overrides the
GOROOT path which is apparently being set by
⨯ build failed after 0.01s error=hook failed: go mod download 30 go: cannot find GOROOT directory: /opt/hostedtoolcache/go/1.14.4/x64
This happens because the docker exec command appears to be setting the
GOROOT env var to
/opt/hostedtoolcache/go/1.14.4/x64 (apparently the value coming from
actions/setup-go@v2). This is reflected in the GitHub Workflow log (https://github.com/ory/cli/pull/11/checks?check_run_id=865292617#step:6:10):
/usr/bin/docker run --name c201270f687b95744d53b57aea51f5a87bec_ed5ed4 --label 87c201 --workdir /github/workspace --rm -e GOROOT ...
I would not expect that two actions have side effects which may break one or the other action. I’ve already observed that with other actions as well (
golangci-lint breaks when
actions/setup-go@v2 is executed prior). How can I prevent this from happening? I do not want to run a dedicated job as a workaround.