ad-m / ad-m/github-push-action

Error when pushing using personal access token -- the requested URL returned error: 403

Offen
#52 8 Kommentare 13 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Shell
Sterne
1.3k
Forks
238
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Context:
Was checking out multiple private repos and was copying a file from a private repos to a public repos in the workspace, then committing and pushing. The push would fail with a 403.

Error:
```
remote: Permission to my-repos denied to github-actions[bot].
fatal: unable to access 'https://github.com/.../my-repos.git/': The requested URL returned error: 403
```

By running this command we can see any of config settings being used for our repos:
```
git config -l
```

We discovered the checkout action is executing a command like this:
```
git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
```
Reference:
https://github.com/actions/checkout/blob/master/adrs/0153-checkout-v2.md#pat

The fix is to do this:
```
git config --local --unset-all "http.https://github.com/.extraheader"
```

It's seems unlikely that this could lead to side effects but it may be desirable to re-set this value after the push is completed.

Sorry for lack of PR, we ended up not using your action and just incorporated what we ended into our workflow file.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.