Replies: 2 comments 1 reply
-
You need to add token to checkout the private repo with correct permissions. How to create PAT with checkout permissions to checkout a private repository ?
|
Beta Was this translation helpful? Give feedback.
-
For anyone who is stumbling about this issue, deploy keys saved my day. They might not for everyone, but in my case we need a tool in different repositories inside the same organization, but don't want personal accounts to be required for auth/access. Situation
Steps to accomplish what you need
Example workflow file with a checkout of repository B: (note: please make sure you use the latest versions of each component used) name: Checkout Repository B
on: [push]
jobs:
checkout-repo-b:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository A
uses: actions/checkout@v3
- name: Setup SSH Key
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Checkout Repository B
run: |
git clone git@github.com:ORGANISATION/REPOSITORY_B.git repository-b About the no-password thing: if you set a password, you have to provide it during the workflow which IMHO defeats the purpose of this approach. The following error will appear if a password-protected SSH key pair ist being used:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I don't get this to work. I have a private repo I need to checkout and use in another private repo of mine.
So inside the workflow I'm doing this:
Also added
token: ${{ secrets.REPO_ACCESS_TOKEN }}
but gettingRetrieving the default branch name. Bad credentials.
What is going wrong?
Beta Was this translation helpful? Give feedback.
All reactions