Skip to content

Document path restrictions #41

Closed
Closed
@narqo

Description

@narqo

After some experiments, it seems that path argument has restrictions on what values can be used. That is, I have tried making checkout to clone the repo into GOPATH workspace, e.g. I required the clone path to be exactly $GOPATH/src/github.com/<owner>/<repo>, but none of the following worked as expected:

Both following variants fired an error that looked like the value of the path couldn't be absolute:

- uses: actions/checkout@v1
  with:
    path: /home/runner/go/src/github.com/${{ github.repository }}

- uses: actions/checkout@v1
  with:
    path: ${{ runner.workspace }}/src/github.com/${{ github.repository }}

The following produced the same error, even though the path wasn't an absolute:

- uses: actions/checkout@v1
  with:
    path: src/github.com/${{ github.repository }}

The following worked, but checkout didn't expand the value of $GOPATH:

- uses: actions/checkout@v1
  with:
    path: $GOPATH/src/github.com/${{ github.repository }}
  env:
    GOPATH: ${{ runner.workspace }}

The only way to made it work as I needed was the following

- uses: actions/checkout@v1
  with:
    path: ./src/github.com/${{ github.repository }}

With the above configuration, I could use env: GOPATH: ${{ runner.workspace }} in the subsequent run steps. See the full example in the PR profefe/profefe#34

That's being said, the restrictions for path requires some clarification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions