github-push-action icon indicating copy to clipboard operation
github-push-action copied to clipboard

Does not work for private repositories

Open e8johan opened this issue 4 years ago • 8 comments

When trying to push to a private repository (the same repo that the action is run from), I get a "fatal: repository 'https://github.com//.git/' not found". I've tried using both secrets.GITHUB_TOKEN, and a PAT (via secrets.DEPLOY_PAT). I'm not sure if I'm doing somethign wrong, but I suspect that it might come down to the repo being private.

e8johan avatar Feb 06 '21 21:02 e8johan

it works for me for private repos with the GITHUB TOKEN so you must have something set up incorrectly.

nsheff avatar Mar 16 '21 12:03 nsheff

I'm trying it from a private repo in a privae org. That might the case. Nevertheless, I managed to work around, so if nobody else encounters this, I'm ok with closing.

e8johan avatar Mar 26 '21 11:03 e8johan

@e8johan How did you solve this? I've tried quite a few ways and still badly stuck with this

samrith-s avatar Apr 27 '21 10:04 samrith-s

@e8johan could you please share the workaround you mentioned?

Szer avatar May 04 '21 12:05 Szer

Hi everyone, I fixed this in our repositories by removing the step and replacing it with:

        - name: Push Commit
          run: git push https://${{ secrets.GITHUB_PAT }}@github.com/<REPO_OWNER>/<REPO_NAME>.git

The repo owner is our organisation and the GITHUB_PAT is a personal access token. Hope this helps! 😉

lukli11 avatar Aug 26 '21 14:08 lukli11

Chances are you'r using actions/checkout@v2 already. It offers a solution to push a commit using the built-in token.

skew202 avatar Nov 30 '21 21:11 skew202

I'm having the same issue as @e8johan. and am using this action in combination with jaumann/[email protected] Hope someone can shed some light on this issue because i'm stuck.

jordyvaneijk avatar Dec 01 '21 14:12 jordyvaneijk

Hi everyone, I fixed this in our repositories by removing the step and replacing it with:

        - name: Push Commit
          run: git push https://${{ secrets.GITHUB_PAT }}@github.com/<REPO_OWNER>/<REPO_NAME>.git

The repo owner is our organisation and the GITHUB_PAT is a personal access token. Hope this helps! 😉

How to make the owner dynamically to the the PR maker?

yasirroni avatar Apr 14 '22 23:04 yasirroni