Not able to checkout remote repo using secrets.GITHUB_TOKEN
See original GitHub issueNot able to check out another private repo using secrets.GITHUB_TOKEN. Below the scenario, check out 1, and 2 works. 3 fails. Is there a limitation for secrets.GITHUB_TOKEN on remote repos?
repo-1 from for which GitHub action is running and repo-2 that it’s trying to checkout is in the same org
jobs:
test:
name: test
runs-on: self-hosted
container: node:14-bullseye
steps:
- name: Checkout 1
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout 2
uses: actions/checkout@v3
with:
token: ${{ secrets.MY_PAT }}
repository: repo-2
ref: 'main'
path: 'path-1'
- name: Checkout 3
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: repo-2
ref: "master"
path: "path-2"
Error: Fetching the repository /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* remote: Repository not found. Error: fatal: repository ‘https://github.com/xxxxxx/’ not found The process ‘/usr/bin/git’ failed with exit code 128 Waiting 11 seconds before trying again
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9
Top Results From Across the Web
remote: Repository not found in GitHub pipeline - Stack Overflow
Did you create the Personal Access Token and add it as a repository secret? This error occurs generally when the secret is empty....
Read more >The GITHUB_TOKEN in GitHub Actions: How it Works ...
Just go to your repository or organization Settings, then click on Actions. Permissions UI. In here you can change the permissions assigned to ......
Read more >GitHub Actions Security Best Practices [cheat sheet included]
Therefore the provided GITHUB_TOKEN will not have write access and the secrets are not accessible either. While these are sane defaults, in some ......
Read more >The ultimate guide to GitHub Actions authentication
If you want to make a change in another repository when a PR is merged, this is not possible with the default GITHUB_TOKEN...
Read more >GitHub Actions: Control permissions for GITHUB_TOKEN
The GITHUB_TOKEN is an automatically generated secret that lets you make ... permissions for the token in your organization or repository.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was facing this same issue and I was able to use a secret only if the secret name is GH_PAT, like this:
token: ${{ secrets.GH_PAT }}
– All the best Christian Fr stormyhr Wednesday, 05 October 2022, 07:29am +02:00 from Dennis Gentry @.*** :