I noticed the documentation for actions says I can't call an action in another private repo that I own. I have a different question. Is it possible to use the checkout action (of my repo) to checkout a public repo, or a private repo owned by me. This would be useful for pulling the latest version of C++ boost header libraries, or another library I wrote that's needed for the build.
Yes, you can
steps:
- uses: actions/checkout@master
with:
name: org1/repo1 <-- clone https://github.com/org1/repo1
ref: refs/heads/release
I tried to clone another private repository with the action but I only get:
##[error]fatal: repository 'https://github.com/orgname/reponame/' not found
step:
- name: Check out my other private repo
uses: actions/checkout@master
with:
repository: orgname/reponame
I tried to pass the github token but doesn't change the outcome.
@maxperrimond try to generate a PAT and set that as repository secret, use that to clone the extra repository, the GITHUB_TOKEN is scope to the workflow repo.
Ex:
- name: Check out my other private repo
uses: actions/checkout@master
with:
repository: orgname/reponame
token: ${{ secrets.my_pat }}
It worked well. Thanks for your support @TingluoHuang
Thanks
If it's from another source outside of github do we use the full URL?
I want to clone multiple repos for together build. How to prevent deleting of prev-cloned repo?

It's my configuration: https://github.com/ElegantNetworking/ElegantNetworkingRoot/blob/master/.github/workflows/gradle.yml
Can anyone help?
Ok, now I solve cloning multiple repos by using path.
But I have a problem with running gradle from inner directory
'cd' command is not work

Yeeeeah! Solved! --project-dir is cool!
@hohserg1 can you elaborate on how you solved it? Can you share youre .yml file?
@orelviz yes.
I use a path parameter of actions/checkout to specify cloning location.
https://github.com/ElegantNetworking/ElegantNetworkingRoot/blob/master/.github/workflows/gradle.yml#L21
Next I use a --project-dir command line parameter of gradle to specify root location of gradle workspace
https://github.com/ElegantNetworking/ElegantNetworkingRoot/blob/master/.github/workflows/gradle.yml#L55
Link to this yml been posted above
@rogerprz did you get it to work with a repo outside of github.com?
@rogerprz did you get it to work with a repo outside of github.com?
I am also wondering if we can clone from another domain besides the one where this action is called. In my case, the domain is githubdev, and I want to clone from regular old github.com.
Currently, this action appends the githubdev domain to the repo arg for the action (org/repo) leading to an incorrect full URL.
@hohserg1 How did you manage to get the clone persistent?
Most helpful comment
@maxperrimond try to generate a PAT and set that as repository secret, use that to clone the extra repository, the GITHUB_TOKEN is scope to the workflow repo.
Ex: