Apologies if this has already come up...I haven't been able to find an answer to this.
I'm attempting to setup Actions for a private GitHub repo. The repo pulls in two submodules, each of which are also private GitHub repos. My Action fails on checkout with ##[error]fatal: Could not read from remote repository.
How do I configure the checkout action with the right credentials to pull in these private submodules?
This is what I currently have for the checkout step as a starting point:
- uses: actions/checkout@v1
with:
submodules: true
I think u need #14
- uses: actions/checkout@v1
with:
submodules: true
token: ${{ secrets.CI_TOKEN }}
CI_TOKEN is a workflow secret & a personal access token, u can configure in the settings section.
Oh! Perfect thanks, that solved my issue :)
You can use too:
- name: Fix up git URLs
run: |
git config --global --add url."https://${{ secrets.GITHUB_SECRET }}:[email protected]/".insteadOf "https://github.com/"
git config --global --add url."https://${{ secrets.GITHUB_SECRET }}:[email protected]/".insteadOf "[email protected]:"
If you are using 2fa or SAML don't forgot to enable SSO on your TOKEN from within your account settings.
Most helpful comment
You can use too: