I need to checkout a private repo during a GitHub Actions workflow. I am using the checkout action, and following its README:
- I created a service account, i.e. a separate GitHub account just for GitHub Actions workflow.
- I created a PAT (Personal Access Token) for the service account, with permission to access the private repo and the current workflow repo.
- I created a secret to store the PAT token.
Now, when I just do the following, it does not work:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{secrets.MY_TOKEN}}
it seems that I did not config git properly to allow it use the token. My question is: should I or how do I configure git config to use token in the above step?
Thanks.
EDIT: The private repo is a dependency of the main repo. Both repos are Rust programs, using Cargo. So I am trying to use the same service account to checkout the main repo first. Then cargo will checkout the private repo.
EDIT 2: Sorry this is a bad question. I didn't know what I was doing. Please ignore.