I have a private repo I need to checkout and use in another private repo. So inside the workflow I'm doing this:
- name: Checkout small private repo
uses: actions/checkout@v2
with:
repository: name/smallprivaterepo
path: build/
I tried using ${{ secrets.REPO_ACCESS_TOKEN }}
and env: GITHUB_TOKEN
without success.
Determining the default branch
Retrieving the default branch name
Not Found
Waiting 18 seconds before trying again
Retrieving the default branch name
Not Found
Waiting 13 seconds before trying again
Retrieving the default branch name
Error: Not Found
The default branch on the private repo i'm trying to fetch is master
. When adding ref: master
to the .yml I get:
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/master*:refs/remotes/origin/master* +refs/tags/master*:refs/tags/master*
Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
The process '/usr/bin/git' failed with exit code 128
Waiting 12 seconds before trying again
OK, i made it work, but i don't know if thats the secure way to do it.
So I already had a PAT in my developer settings: https://github.com/settings/tokens
Then I added a secret named MYPAT to the repo that is trying to checkout the private repo. That secret contains the PAT token!
Then only added this to the yml:
token: ${{ secrets.MYPAT }}
So the PAT token is actually saved twice in github.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With