Security Violation: Golang Action: How to change GITHUB_WORKSPACE and checkout to that dir?

There is a problem with the default Golang Action from Github that it checks out code into the ${GITHUB_WORKSPACE}/work/ directory.

This is not compliant to older Golang runtimes that do not support outside-of-the-${GOPATH} location for builds and package support.

I am currently running into a problem checking out supporting packages, that compiles to a binary, and needs to inspect my code. 

The problem is that remote packages are not allowed to import absolute pathnames, as per Golang security requirements (to protect the user from malicious package imports).

Forcing the code checked out into this non-standard /work/ directory violates that standard.

What I have to do to work around this is to not use the Github golang action and instead manually checkout my code, and forcing a change directory everywhere to the proper workspace.

name: Go
on: [push]

    name: Build
    runs-on: ubuntu-latest
      fail-fast: true


    - name: Set up
      uses: actions/setup-go@v1
        go-version: 1.12
      id: go

    - name: Check out code the Go-Way
      run: go get${GITHUB_REPOSITORY}

    - name: Get dependencies
      run: |
        cd ~/go/src/${GITHUB_REPOSITORY}
        go get -v -t -d ./...
        if [-f Gopkg.toml]; then
            curl | sh
            dep ensure
        go get -v
        go install -v

    - name: Build
      run: |
        cd ~/go/src/${GITHUB_REPOSITORY}
        go build -v ./...

    - name: Test
      run: |
        cd ~/go/src/${GITHUB_REPOSITORY}
        go test -covermode count -coverprofile cover.out
        ~/go/bin/goveralls -v -service github-actions -repotoken=${{ secrets.coveralls }} -coverprofile=cover.out

    - name: Benchmark
      run: |
        cd ~/go/src/${GITHUB_REPOSITORY}
        go test Benchmark -cpu 1 -bench .

As you can see, this is pretty annoying to CD each time I want to perform an action.

PS: Since the Jobs -> Job -> ENV option does not expand ENV vars, that doesn’t seem to be an agnostic option either.  Because it would require hardcoding the username and repository.  See this issue:

PSS: The original problem happens when trying to run the newly installed goveralls binary.  It tries to inspect the files located in the cover.out file (which is a list of absolute paths on the system).  Golang only allows the import of relative paths to the $GOPATH (which is ~/go/src/) when tools are installed with go get ….