Github Actions remote repo issues

I am using Github and I need to implement a feature using Github Actions as per below:

I have two repos - one private and one public. Whenever a pull request is created for ‘master’ branch on the public reposity we need to push the source branch (altogether) into the private repository.

My workflow file looks like below:

  # This workflow contains a single job called "build"
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      # Runs a set of commands using the runners shell
      - name: Run a multi-line script
         INTERVIEW_TOKEN: ${{ secrets.INTERVIEW_TOKEN }}
        run: |
          echo ${{github.head_ref}}
          git remote -v 
          git fetch
          git checkout ${{github.head_ref}}
          git remote add private-origin https://stoicad:$
          git remote -v 
          git push -u private-origin ${{github.head_ref}}

It should be pretty straightforward:

  • fetch from origin
  • checkout PR ‘source’ branch
  • set a new remote (called private-origin) - the generated token has all permission!
  • check to see if the new remote was set
  • push changes to private-repo

The actual result:

origin (fetch)
origin (push)
 * [new branch]      PR_TEST_BRANCH -> origin/PR_TEST_BRANCH
 * [new branch]      master         -> origin/master
Previous HEAD position was 7607d53 Merge e1fa33b54d0611dd0b5c5ccfe86d9d00442cdcbb into f882b0a96f557dfe1614fb79920799167b1963a7
Switched to a new branch 'PR_TEST_BRANCH'
Branch 'PR_TEST_BRANCH' set up to track remote branch 'PR_TEST_BRANCH' from 'origin'.
origin (fetch)
origin (push)
private-origin  *** (fetch)
private-origin  *** (push)
remote: Repository not found.
fatal: repository '' not found
Error: Process completed with exit code 128.

Am I missing something? Both repositories were created by myself, the generated token has for sure all the rights, what else can be? Why it throws an error saying “Repository not found”?