checkout: repository not found

[edited by @ericsciple] Sorry for the disruption. There is an active incident right now that is causing the GITHUB_TOKEN to not have permission to checkout private repos.

Everything was working fine until all of the sudden this error started to popup and I have no idea why. Can it be a GitHub service issue or maybe a recent release that introduced a bug. It’s a private repository I don’t know if that can help debug the issue.

Workflow stack

/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +7f692a64151c6ae3be4518df16d88b891eb76c1b:refs/remotes/origin/master
  remote: Repository not found.
  ##[error]fatal: repository 'https://github.com/DgRosa/likacrm/' not found
  The process '/usr/bin/git' failed with exit code 128

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 283
  • Comments: 195 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Ran into this, but noticed I no longer get the issue after enabling all the permissions. After some debugging I found a fix: explicitly define the contents: read permission like so:

    permissions:
      contents: read # Explicitly add this.

It also works if you remove the permissions key (by default the bare minimum permission is contents: read).

@GitHub Team - that’s why you don’t do deployments on Friday 😁

EDIT: November 27th 2020 - repeat error & they did it again on Friday 🤦 😂

Ran into this, but noticed I no longer get the issue after enabling all the permissions. After some debugging I found a fix: explicitly define the contents: read permission like so:

    permissions:
      contents: read # Explicitly add this.

It also works if you remove the permissions key (by default the bare minimum permission is contents: read).

Thanks for the fix!

For everyone coming from Google, here is the explanation.

I followed this guide to setup configure-aws-credentials action. One of the requirement is workflows or jobs needs

permissions:
  id-token: write

key. This overrode default permissions key, hence my Github Actions stopped working with Repository not found. error. To fix the error you have to redefine the default permissions.

Your permissions should look like this:

permissions:
  id-token: write
  contents: read # default

It’s reporting the same error again…

If you are getting this error when trying to checkout the repo your action is running in, make sure your job has sufficient permissions.

In my case, I changed the job permissions, like below:

permissions:
      packages: write

Which seems to have overwritten the default contents: read permission.

Fix:

permissions:
      contents: read
      packages: write

This fixed my issue.

I think it’s something to do with private repos? I just reran some public repo actions and they worked correctly, but my private repos are failing every time.

BRUHHHHh, why do they always do this on Fridays !!!

For anybody running into this issue in 2023, it is likely caused by downtime of the GitHub API or insufficient workflow permissions. You can check your workflow permissions by going to Set up job>GITHUB_TOKEN permissions in your workflow console.

image

Your workflow should show the contents: read permission here. This permission is automatically granted unless you overwrite your workflow permissions using the github action permissions key. In that case you have to make sure the contents key is present among the other permissions you want to grant since the use of this key will remove all default permissions.

permissions:
+  contents: read
   pull-requests: write

Please use emojis to react and add comments only to provide new information. Most of us receive a tons of emails due to the subscribe.

I fully agree that this isse needs to be re-opened. The fix from @donovanclarke doesn’t seem to work anymore. FYI. I am the only user for my own namespace and the owner for my org account. Irrespective of whatever I try, I am unable to access a private repo from my org namespace in my user namespace’s workflow

+1 on this. Github actions suddenly started giving this error. “Investigating - We are investigating an increase in errors on GitHub.com.” I think this is due an error in github. Check https://www.githubstatus.com/

I’m working in a private repo which is part of an org with SSO enabled. I’m using an action which sets PR comments so had permissions configured:

permissions:
  pull-requests: write

I got the “repository not found” error, to which this thread helped me by suggesting I add the contents: read line:

permissions:
  contents: read
  pull-requests: write

Seemed to work! Thanks all.

@Siddharth-Ashri use the default token but add the permissions required:

# ...
jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read  # <--- allows to read repo
    steps:
      - uses: actions/checkout@v3
# ...

It works now 😃

-> so everyone’s running to hit the PUSH button 🤣

Seems to be working now 😄

Guys, just specify a custom token as suggested above. So your workflow should look like this:

- uses: actions/checkout@v2
  with:
    token: ${{ secrets.YOUR_SELF_MADE_TOKEN }}

And be sure that this token has permissions repo to access the private repo that you want to checkout from.

Let me post it again. Guys, just use a custom token for this. You don’t have to implement the wheel here, it works just fine with a custom token, not the one provided by the github automatically. I think there is nothing to fix here, please don’t expect any official fixes. The issue is closed for a long time already…

Guys, just specify a custom token as suggested above. So your workflow should look like this:

- uses: actions/checkout@v2
  with:
    token: ${{ secrets.YOUR_SELF_MADE_TOKEN }}

And be sure that this token has permissions repo to access the private repo that you want to checkout from.

For everybody still getting Unable to resolve action xxx, repository not found when using a private action:

Go to the private action repo, Settings, General. There, allow the repo to be accessed by other personal or organizational repos:

Screenshot 2022-12-16 at 08 13 49

Resolved my issue

permissions:
  contents: read
  packages: write

and here where to use it:

name: GitHub Actions
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
permissions:
  actions: write       # Necessary to cancel workflow executions
  checks: write        # Necessary to write reports
  pull-requests: write # Necessary to comment on PRs
  contents: read
  packages: write
on: [pull_request]
jobs:
  setup_dependencies:
    timeout-minutes: 120
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

I am running into this issue as well. Pipeline output:

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ac7662823a1592ed9609f383336921a258d8bf42:refs/remotes/origin/master
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/my-user/my-repo/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 13 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ac7662823a1592ed9609f383336921a258d8bf42:refs/remotes/origin/master
  Error: error: RPC failed; HTTP 404 curl 22 The requested URL returned error: 404
  Error: fatal: expected 'packfile'
  The process '/usr/bin/git' failed with exit code 128
  Waiting 13 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ac7662823a1592ed9609f383336921a258d8bf42:refs/remotes/origin/master
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/my-user/my-repo/' not found
  Error: The process '/usr/bin/git' failed with exit code 128

Thanks for this issue! I literally merged our first workflow 90 minutes ago and have been debugging the broken CI ever since. Knowing it’s service degradation is of some relief.

The issue re-appeared for me today Aug 12th 2022 in one of our internal org repository pipelines. Am I the only one or is anybody else affected as well?

Pipeline error message:

Run actions/checkout@v3.0.2
Syncing repository
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/g56ead65-d649-3162-91a3-0647a0391e0e' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/my-app
Deleting the contents of '/home/runner/work/my-app/my-app'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +4926e26deg4364f36e2f316e24e6e3efd21e20:refs/remotes/origin/fix/test
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/my-org/my-app/' not found

Configuration in our .yml file:

jobs:
  ci:
    name: 'Continuous Integration'
    if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'}}
    runs-on: ubuntu-latest
    timeout-minutes: 20
    outputs:
      configs: ${{ steps.load-oneaudi-cli.outputs.configs }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3.0.2
        with:
          ref: ${{ github.event.release.target_commitish }}
          token: ${{ secrets.PACKAGES_TOKEN }}

Not working for private repo

+1 also just started to happen on our private repos

Using token: ${{secrets.TOKEN}} with a Personal Access Token with permissions to read the repo contents/commits did fix it for me. See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token for creating the token.

same issue – the problem happens only when you need to deploy a hotfix 🤣

@ilgooz there is an ongoing investigation - it’s known. Not an issue w/ this repo as you mentioned.

If you are getting this error when trying to checkout the repo your action is running in, make sure your job has sufficient permissions.

In my case, I changed the job permissions, like below:

permissions:
      packages: write

Which seems to have overwritten the default contents: read permission.

Fix:

permissions:
      contents: read
      packages: write

This fixed my issue.

Just wanted to say that this comment here helped fix the issue.

Though to debug possibly why this is happening, it would be helpful to check the Setup job and the permissions assigned to the GITHUB_TOKEN permissions.

Issue still persisting as of 11:16AM EST

@DgRosa Can we re-open this issue? Still failing.

I all of a sudden ran into this issue today, when attempting to apply this action to an company internal github repo.

Changing

permissions: actions: read pages: write id-token: write

to

permissions: actions: read contents: read pages: write id-token: write

seems to have fixed it for me at least.

(using actions/checkout@v3)

I am also running into this issue today. But not sure if my cause is the same. I am setting up a runner that checks out 2 git repos. It succeeds on getting the repo where the action is located, but fails in the same manner on the 2nd repo.

Pipeline output:

Run actions/checkout@v3
  
Syncing repository: gridpoint-com/gpec-rootfs
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/db755f50-2c76-4e65-817e-060360ecd7d6' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/gpec-rootfs/gpec-rootfs
Deleting the contents of '/home/runner/work/gpec-rootfs/gpec-rootfs'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/bin/git log -1 --format='%H'
'1f93a63ca438eb1a149d46a4556cbb1aaaf973c2'
31s
Run actions/checkout@v3
Syncing repository: gridpoint-com/gpec-drun
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/cfa2af[27](https://github.com/gridpoint-com/gpec-rootfs/runs/7814703085?check_suite_focus=true#step:3:29)-83ca-44fa-afc9-1406e52c84f1' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/gpec-rootfs/gpec-rootfs/bin
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=[1](https://github.com/gridpoint-com/gpec-rootfs/runs/7814703085?check_suite_focus=true#step:4: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/gridpoint-com/gpec-drun/' not found

yml:

jobs:
  show-info:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
    steps:
      - name: Checkout rootfs
        uses: actions/checkout@v3
      - name: Checkout drun
        uses: actions/checkout@v3
        with:
          repository: gridpoint-com/gpec-drun
          ref: master
          path: bin

Why is this issue closed? Seems like a lot of people, myself included, are still having this issue?

After going through the comments it is not clear what to do to solve the issue.

I have configured Accessible from repositories in the .... organization, I have a token with repo, enabling workflow read and write permissions, adding permissions: contents: read inside the job, and adding github_token: ${{ secrets.MY_TOKEN }} in the with: section.

After all that I am still getting the error remote: Repository not found. is there anything missing?

Go to project settings in the respective github repo -> On the left menu, select Actions -> General -> In Workflow permissions, select Read and write permissions -> Re run failed jobs it should work

I would love to take a break but it works for me 😢 image

Same - time for me to take a break and walk my imaginary dog 🐶

Anyone know if this is an issue with Github itself, or specific to the code in this action?

Probably due to an issue with Github APIs. We are using a fixed version of checkout which is @v2 and still experiencing this issue.

@ericsciple can you please report this issue to the team?


I got more news, the status page is yellow, there seems to be an incident ATM. See: https://www.githubstatus.com/

I am also having this exact same issue. It started appearing somewhere in the last hour to our private repos.

These workaround are not working for me either.

Both repositories are in the same organization. And the second repo is configured to be available to workflows in the org (I have also tried setting it to be available to workflows enterprise wide but to no difference in outcome). My workflow still says the repo was not found. If i make the repo public it works, and if i set an organizational token (which i cant make last longer than 90 days), then it works fine.

we’re experiencing this issue too, which sucks cause I would much rather use the GITHUB_TOKEN secret for actions rather than a PAT. Is there any word on if this is being fixed and if not is there a reason (like low priority since there’s a feasible, yet less optimal in some ways workaround)? I’d imagine most github actions workflows involves checking out the current private repo so this would be a show stopper for many. It’s unfortunate cause I love the idea of using just the GITHUB_TOKEN and managing that tokens permissions in the YAML file itself

@jayconscious If I remember it correctly the issue was fixed for me when I switched from using the general GITHUB_TOKEN to a self-created secret token https://docs.github.com/en/actions/reference/encrypted-secrets.

working for me now on private repos

Ya, its working prefectly

Failling on private repos

I’m experiencing the same.

Anyone know if this is an issue with Github itself, or specific to the code in this action?

Pretty sure it has nothing to do with the checkout action. The latest code change is yesterday, but it was running fine this morning.

If you are getting this error when trying to checkout the repo your action is running in, make sure your job has sufficient permissions. In my case, I changed the job permissions, like below:

permissions:
      packages: write

Which seems to have overwritten the default contents: read permission. Fix:

permissions:
      contents: read
      packages: write

This fixed my issue.

Just wanted to say that this comment here helped fix the issue.

Though to debug possibly why this is happening, it would be helpful to check the Setup job and the permissions assigned to the GITHUB_TOKEN permissions.

Where are you putting this section? Under runs-on within jobs?

Unfortunately this is happening when accessing the very private repo the workflow is in, no repository parameter is specified. The workflow simply can’t write back to the repo, it can only read. Personally I prefer not having to involve admins to create deploy tokens if it can be resolved this way, but it is a personal preference. Again, thanks for picking this up @yurist38

Not working for any of my private repos

Oof, I thought my private repo has been banished to the shadow realm. Gave me a scare!

image Right now

You’re right, not working again…

Please use emojis to react and add comments only to provide new information. Most of us receive a tons of emails due to the subscribe.

We can start to subscribe to the issue with this button without adding a comment.

Screen Shot 2020-05-23 at 5 23 35

I wish github can provide a better error message regarding this issue. It’s really the permissions that’s causing this

Me too. It used to work well, but started throwing this error from yesterday.

The workaround is add the contents permission, if it’s not there.

permissions:
  contents: read

Just ran into this issue today with a company github repo. Still have not find a solution.

I think this issue needs to be re-opened. Enabling Accessible from repositories in the '<Organization name>' organization has no effect.

Is this stil an issue, I am using actions/checkout@v4 and yesterday everything went fine but today it is failing with exactly this error: Fetching the repository /usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* remote: Repository not found. Error: fatal: repository 'https://github.com/hamburgcodingschool/website/' not found The process '/usr/bin/git' failed with exit code 128 Waiting 18 seconds before trying again

I was also experiencing this issue with actions/checkout@v4 and explicitely granting the job read permissions to the content solved it as @donovanclarke proposed:

permissions:
    contents: read 

@MiltiadisKoutsokeras can you copy your workflow file including the permissions definition?

It still doesn’t work, even specifying the permissions

While waiting for an ufficial fix, I resolved it by changing the way the runner authenticates to the repo by using this step.

    - name: Bump version
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
        run: |
          npm run release
          git remote rm origin
          git remote add origin https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/project/repo.git
          git remote -v # for debug only 
          git show-ref # for debug only 
          git push --follow-tags origin HEAD:master

This works for both actions/checkout@v1 and actions/checkout@v2 (haven’t tested others).

same Been having this issue despite enabling the options down below in both the organization repository and the forked repository.

image

If I am using it wrong is there another way to fetch a private forked repository. Our organization has forked repo + pull_request model and I am trying to lint my code on the forked repo based on the logs the Actions do have the write permission on the forked repo but cannot find the repo itself.

The only solution I have found is by creating a PAT in the forked repo and then using that as an environment secret but that isn’t scalable to other forks of the repository.

Not working for me.

Unable to resolve action GoogleCloudPlatform/google-github-actions@master, repository not found

Just faced this error too on a private repo…

[UPDATE] I’ve just managed to fix it by specifying another token explicitly. 🎉 Try that too! 😉

Same issue here

@stauffenberg2020, go to https://github.com/settings/tokens and create a new token. Set no expiration date, and click on the “repo” scope in access permissions. Then go to https://github.com/organizations/<your-organization>/settings/secrets/actions and set ORG_TOKEN to the newly created token. Then use ORG_TOKEN instead of GITHUB_TOKEN in problematic places.

Does anybody know an up-to-date workaround? Got this issue today. None of the above workarounds worked for me.

UPD: setting up a custom organization-level personal access token and using it instead of GITHUB_TOKEN worked. This issue seems to be a problem with GITHUB_TOKEN specifically.

Is this stil an issue, I am using actions/checkout@v4 and yesterday everything went fine but today it is failing with exactly this error: Fetching the repository /usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* remote: Repository not found. Error: fatal: repository 'https://github.com/hamburgcodingschool/website/' not found The process '/usr/bin/git' failed with exit code 128 Waiting 18 seconds before trying again

Were you ever able to get this worked out? I was trying to set up a Secret with a PAT and noticed this message:

Private repositories Organization secrets cannot be used by private repositories with your plan.

So I think that might be my problem, but I’ve been going down this rabbit hole for hours now 😦

@MiltiadisKoutsokeras

Interesting your GITHUB_TOKEN permissions seem off.

Though I did notice you are running checkout@v3, could possibly bumping to checkout@v4 while using

permissions:
  contents: read

I am taking a wild swing, but, i was having the issue you were having, and mine was resolved and this is the only thing i can possibly see that was different. Besides your GITHUB_TOKEN that you are using doesn’t have the appropriate permissions.

thank you @donovanclarke

contents: read did fix our issue remote: Repository not found.

I’m using a private repo from a workflow in a public repo. I use deploy keys to grant access and bumped into the same issue. The output of a successful run shows:

Set up job
   Secret source: Actions
Run actions/checkout@v3
with:
   repository: my-org/my-private-repo
   ssh-strict: true
   ssh-key: ***

The output of a failing run:

Set up job
    Secret source: Dependabot
Run actions/checkout@v3
with:
    repository: my-org/my-private-repo
    ssh-strict: true

This is explained by the docs:

When a Dependabot event triggers a workflow, the only secrets available to the workflow are Dependabot secrets. GitHub Actions secrets are not available. If you have a workflow that will be triggered by Dependabot and also by other actors, the simplest solution is to store the token with the permissions required in an action and in a Dependabot secret with identical names.

Hope it is helpful to someone

I noticed the following:

If repository checkout uses this command:

/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +a57ded8d9aeaa73017e827ec71ae20c707023798:refs/remotes/pull/1/merge

it fails, where the successful runs use this command:

/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ef3143233ce2acaa16fbcda0c990b259dc5724f3:refs/remotes/origin/develop

The failing command seems to use a ref that is not part of a branch.

@jkruse14 Of course. See below our Github Action yaml (not verbatim copy in order to protect secrets) it fails on Source Code checkout:

# Workflow for main Git actions
name: Main GitHub Actions

# This workflow runs on push and pull-requests on specific branches
on:
  push:
    # Cannot push straight to main by GitHub organization policy, only develop
    # suffices.
    branches:
      - develop
  pull_request:
    branches:
      - main
      - develop

# Jobs that will run (in parallel by default) within this workflow
jobs:
  check_code:
    # This is the container runner host.
    runs-on: ubuntu-latest
    # Only run this job if the current repository is different than the template
    # We do not want to overwrite the template itself...
    if: ${{ github.repository	!= '<project template here>' }}
    # This is the container runner. Run on Debian 11, Python 3.9 image
    container:
      image: python:3.9-bullseye
    steps:
      # Check GitHub Actions secrets
      - name: Check GitHub Actions secrets
        shell: bash
        run: |
          if [[ \
          "${{ secrets.SSH_PRIVATE_DEPLOY_KEY }}" = "" \
          ]]
          then
            echo "Action secrets are not setup properly"
            exit 1
          fi
          exit 0
      # Dump the GitHub context for analysis
      - name: Dump GitHub context
        shell: bash
        env:
          GITHUB_CONTEXT: ${{ toJSON(github) }}
        run: |
          echo "$GITHUB_CONTEXT"
      # Install NodeJS required by GitHub SSH Authentication
      - name: NodeJS installation
        shell: bash
        run: apt update && apt install --assume-yes nodejs
      # Setup GitHub SSH authentication
      - name: GitHub SSH Authentication
        uses: webfactory/ssh-agent@v0.5.4
        with:
          ssh-private-key: |
            ${{ secrets.SSH_PRIVATE_DEPLOY_KEY }}
      # Checks-out your repository under $GITHUB_WORKSPACE
      - name: Source Code checkout
        uses: actions/checkout@v3
        with:
          submodules: recursive
      # Make sure that GITHUB_WORKSPACE is a safe Git directory
      # See issue: https://github.com/actions/checkout/issues/1169
      - name: Make GITHUB_WORKSPACE a safe Git directory
        run: git config --system --add safe.directory ${GITHUB_WORKSPACE}
      # Prepare the Python development environment
      - name: Prepare the Python development environment
        shell: bash
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/create_python_venv.sh
      # Check the code format
      - name: Check the code format
        shell: bash
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/check_code_format.sh
      # Check the code linter errors and warnings
      - name: Check the code linter errors and warnings
        shell: bash
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/code_linter.sh
      # Print final message report
      - name: Print Report
        shell: bash
        run: echo "Successfully checked source code of ${{ github.repository }}"

  unit_tests:
    needs: check_code
    # This is the container runner host.
    runs-on: ubuntu-latest
    # This is the container runner. Run on Debian 11, Python 3.9 image
    container:
      image: python:3.9-bullseye
    steps:
      # Check GitHub Actions secrets
      - name: Check GitHub Actions secrets
        shell: bash
        run: |
          if [[ \
          "${{ secrets.SSH_PRIVATE_DEPLOY_KEY }}" = "" \
          ]]
          then
            echo "Action secrets are not setup properly"
            exit 1
          fi
          exit 0
      # Dump the GitHub context for analysis
      - name: Dump GitHub context
        shell: bash
        env:
          GITHUB_CONTEXT: ${{ toJSON(github) }}
        run: |
          echo "$GITHUB_CONTEXT"
      # Install NodeJS required by GitHub SSH Authentication
      - name: NodeJS installation
        shell: bash
        run: apt update && apt install --assume-yes nodejs
      # Setup GitHub SSH authentication
      - name: GitHub SSH Authentication
        uses: webfactory/ssh-agent@v0.5.4
        with:
          ssh-private-key: |
            ${{ secrets.SSH_PRIVATE_DEPLOY_KEY }}
      # Checks-out your repository under $GITHUB_WORKSPACE
      - name: Source Code checkout
        uses: actions/checkout@v3
        with:
          submodules: recursive
      # Make sure that GITHUB_WORKSPACE is a safe Git directory
      # See issue: https://github.com/actions/checkout/issues/1169
      - name: Make GITHUB_WORKSPACE a safe Git directory
        run: git config --system --add safe.directory ${GITHUB_WORKSPACE}
      # Prepare the Python development environment
      - name: Prepare the Python development environment
        shell: bash
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/create_python_venv.sh
      # Run the unit tests
      - name: Run the unit tests
        shell: bash
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/unit_tests.sh
      # Print final message report
      - name: Print Report
        shell: bash
        run: echo "Successfully executed unit tests of ${{ github.repository }}"

+1 It still happens on a private repository that uses deployment keys to access other private repositories. The GitHub action settings are set to:

  • Actions permissions: Allow all actions and reusable workflows
  • Workflow permissions: Read and Write permissions
  • Access: Not accessible

Log error:

ERROR: Repository not found.
Error: fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
The process '/usr/bin/git' failed with exit code 128

In my case, my workflow looked something like this:

name: my workflow

on:
  ...

permissions:
  content: write

jobs:
  job1:
    permissions:
       id-token: write
  steps:
    ...

I was under the incorrect impression that workflow level permissions propagated down. HOWEVER, leaving it out sets it to none, because I could not even read the repository. I was getting remote: repository not found or something to that effect.

If you add permissions to your workflow make sure you all the permissions (its replacing not additive). Otherwise you’ll break like this.

Thanks @yurist38 . I have no problem with creating as many YOUR_SELF_MADE_TOKEN’s as I need in my own private repos but the problem rises when I need to automate package releases for the organisation I work for. Could you please provide a solution that doesn’t involve the user having to provide custom parameters and that simply leverages pre-existing secrets and env variables? Until then, please provide a fault in this solution so we can progress with this issue. Thanks for picking this up

Thanks anyway. If it will not work, I know now where the screw is.

When actions/checkout runs fetches the master version of this repo? I mean github tries to fetch the most recent version?

I had @v1 on mine and switched to @master when I saw the problem happening but no luck. I think it’s related to the current github situation. https://www.githubstatus.com/

Same here. Issue with private repo deployment. Spent like and hour figuring it out. Feel like such an idiot not having a look here first!

Only affects our private repos, public ones still work fine.

Same for me

I’m experiencing this issue too! 👍

+1 . Same issue with GitHub Actions and private repos.