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

$GITHUB_WORKSPACE moves when using with.path on repo where action is executed #63

Closed
Xilonz opened this issue Nov 4, 2019 · 7 comments
Assignees
Milestone

Comments

@Xilonz
Copy link

Xilonz commented Nov 4, 2019

$GITHUB_WORKSPACE moves when using with.path on repo where action is executed (or when first fired?)
Repository is current at '/home/runner/work/repo/repo', move to '/home/runner/work/repo/site'.

This looks like it was intended by the author, but there's no (documented) way to avoid this.
In my use-case, I have 2 repo's: One with my site's files and one with ansible-playbooks for deployment:

    - uses: actions/checkout@v1
      with:
        repository: ${{ github.repo }}
        ref: ${{ github.sha }}
        path: $GITHUB_WORKSPACE/site
    - uses: actions/checkout@v1
      with:
        repository: user/ansible
        ref: master
        token: ${{ secrets.GIT_PAT }}
        path: $GITHUB_WORKSPACE/ansible
        fetch-depth: 1 

The goal is to have both of these available in a docker action $GITHUB_WORKSPACE, so I have access to both repo's inside a docker action. I know there are other solutions for this, but this is the most elegant way.

-edit- I experienced this gives issues with .github/* files not being on their expected places, so I understand that $GITHUB_WORKSPACE has to move with its primary repo. I'd still like to know how I then would be able to achieve something like mentioned above.

@smac89
Copy link

smac89 commented Nov 9, 2019

I faced this issue myself. My current strategy is to use a regular git clone for the second repo.

@ericsciple
Copy link
Contributor

acitons/checkout@v2 will fix this behavior. here is the pr

i'm expecting to merge probably early next week

@danechitoaie
Copy link

danechitoaie commented Nov 23, 2019

@ericsciple any chance you can add support for cloning the other repos with a SSH key for v2?
It would make things a bit more secure. With a PAT you basically give access to all the repos that user has access. With a SSH key you could give access only to the specific repo the SSH key is setup for.

@ericsciple
Copy link
Contributor

@chrispat regarding priority for ssh?

this sounds like an option we would be able to add later without breaking compat - e.g. 2.1

@ericsciple
Copy link
Contributor

@danechitoaie i like the suggestion. Want to open a separate issue and i'll mark it as enhancement?

@ericsciple ericsciple self-assigned this Nov 23, 2019
@ericsciple ericsciple added this to the v2 milestone Nov 23, 2019
@danechitoaie
Copy link

@ericsciple Done. Created #72

@ericsciple
Copy link
Contributor

Fixed in v2-beta. I'll create a v2 tag tomorrow.

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

No branches or pull requests

4 participants