title: How to push to another repository in github actions?
body: <p>In Github Actions, I'm trying to make some changes to a different repo than the repository the workflow belongs to. See this code:</p>
  <pre><code>      - name: Generate API module
          env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          run: |
  
            git clone https://user:$GITHUB_TOKEN@github.com/owner/my-repo # This works
  
            cd my-repo
            git config user.name &quot;user&quot;
            git config user.email &quot;dev@example.com&quot;
  
            git checkout -b api-version-$COMMIT
  
            touch new-file.sh
            git add new-file.sh
            git commit -m &quot;Add new file&quot;
  
            git remote -v # Prints:
            # origin ***github.com/owner/my-repo.git (fetch)
            # origin ***github.com/owner/my-repo.git (push)
  
            git push --set-upstream origin api-version-$COMMIT # This does not work
            git push --set-upstream https://user:$GITHUB_TOKEN@github.com/owner/my-repo api-version-$COMMIT # This does not work either
  </code></pre>
  <p>I can clone the owner/repo repository just fine. I can checkout the new branch, add the file and commit the changes. The problem occurs when I try to push the changes upstream. That doesn't work at all, and I get this error:</p>
  <pre><code>remote: Repository not found.
  fatal: repository 'https://github.com/owner/my-repo/' not found
  </code></pre>
  <p>I'm just guessing that it has something to do with authentication. The <code>GITHUB_TOKEN</code> is a personal access token and has all possible permissions.</p>
  <p>What gives?</p>