Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing `with.path` does nothing #57

Closed
tsal opened this issue Oct 16, 2019 · 6 comments
Closed

Providing `with.path` does nothing #57

tsal opened this issue Oct 16, 2019 · 6 comments
Assignees
Milestone

Comments

@tsal
Copy link

@tsal tsal commented Oct 16, 2019

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.

@repinel

This comment has been minimized.

Copy link

@repinel repinel commented Nov 1, 2019

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.

@kf6kjg

This comment has been minimized.

Copy link

@kf6kjg kf6kjg commented Nov 11, 2019

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.

@macgills

This comment has been minimized.

Copy link

@macgills macgills commented Nov 20, 2019

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

@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Nov 22, 2019

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
@ericsciple ericsciple self-assigned this Nov 23, 2019
@ericsciple ericsciple added this to the v2 milestone Nov 23, 2019
@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Dec 3, 2019

@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

@ericsciple ericsciple closed this Dec 3, 2019
@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Dec 13, 2019

published v2 tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.