Checkout: Providing `with.path` does nothing

Created on 16 Oct 2019  路  6Comments  路  Source: actions/checkout

jobs:
  handle_labels:
    if: contains(github.event.label.name, 'build-for-integration')
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master
      with:
        repository: ${{ 'private-org/github-actions' }}
        token: ${{ secrets.GH_TOKEN }}
        fetch-depth: 1
        ref: 'v1'
        path: ./github-actions
    - name: Check local directory structure
      run: |
        cd github-actions

Results in:

/home/runner/work/_temp/{hash}.sh: line 1: cd: github-actions: No such file or directory
##[error]Process completed with exit code 1.

removing / adding ./ in various combination has no effect; in addition, providing the full workspace path / variable gives the dreaded "rooted path" error.

Most helpful comment

Running into a similar issue. The checkout steps seems to succeed, but the following steps cannot find the path where the repository were supposed to have been checked out.

All 6 comments

Running into a similar issue. The checkout steps seems to succeed, but the following steps cannot find the path where the repository were supposed to have been checked out.

It's because the workspace, aka the CWD of all subsequent steps, is changed automatically to the path given.

My intuition said that with.path would check out into a folder at the given location. No, instead it creates the folder and then _replaces_ the workspace folder with that new folder - wiping out anything you had in there before. Had to determine this empirically, and it's very frustrating as my build system requires a library to be downloaded in a folder that is a sibling of the checked out folder - and I wan to cache said library.

Has the functionality changed? In my build I check out the repo the yml is in and then clone a different repo which runs and then I guess just chucks it into nothingness because I am left with only the original repo after running an ls

actions/checkout@v1 path rules are a little bit complex:

  • if you specify path, and checkout the main repo (the one that kicked off the workflow) then github.workspace moves to follow wherever the repo gets checked out
  • if you specify path foo, and checkout some other repo then it is placed on disk at ${{ github.workspace }}/../foo

early next week i'm planning to publish actions/checkout@v2 (PR) which will simplify the rules:

  • path is always rooted against github.workspace

@tsal i'm going to go ahead and close this issue (see path rules above). let me know if any remaining issue

fyi, master currently reflects v2-beta. try it out and let me know what you think. waiting for a little bit of feedback/stabilization period then will release v2 tag

published v2 tag

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gitfool picture gitfool  路  3Comments

pdcmoreira picture pdcmoreira  路  3Comments

chorrell picture chorrell  路  4Comments

grst picture grst  路  3Comments

rster2002 picture rster2002  路  7Comments