Skip to content

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

Closed

Description

@Xilonz

$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.

Activity

  1. smac89 commented on Nov 9, 2019

    @smac89

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

  2. ericsciple commented on Nov 22, 2019

    @ericsciple
    Contributor

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

    i'm expecting to merge probably early next week

  3. danechitoaie commented on Nov 23, 2019

    @danechitoaie

    @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.

  4. ericsciple commented on Nov 23, 2019

    @ericsciple
    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

  5. ericsciple commented on Nov 23, 2019

    @ericsciple
    Contributor

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

  6. self-assigned this
    on Nov 23, 2019
  7. added this to the v2 milestone on Nov 23, 2019
  8. danechitoaie commented on Nov 23, 2019

    @danechitoaie

    @ericsciple Done. Created #72

  9. ericsciple commented on Dec 13, 2019

    @ericsciple
    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions