Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation and error handling of missing permission to create PRs #557

Open
dreua opened this issue Jul 14, 2023 · 2 comments
Open
Labels
good first issue Good for newcomers

Comments

@dreua
Copy link
Contributor

dreua commented Jul 14, 2023

First of all thanks for the action! It worked well for me in my test-setup but after adding it to another repo it failed, that's why we're here:

I got these errors until I figured out that I needed to change the settings of my repository. It would have been nice to have a hint in the Readme (did I not see it?) and ideally directly in the error message hinting at what needs to be configured.

Run gr2m/create-or-update-pull-request-action@v1.x
Branch "create-or-update-pull-request-action" does not yet exist on remote.
Error: Command failed with exit code 128 (Unknown system error -128): git push -f ***github.com/dreua/flatpak-module-qpdf-pikepdf.git HEAD:refs/heads/create-or-update-pull-request-action
    at makeError (/home/runner/work/_actions/gr2m/create-or-update-pull-request-action/v1.x/dist/index.js:7699:11)
    at handlePromise (/home/runner/work/_actions/gr2m/create-or-update-pull-request-action/v1.x/dist/index.js:10615:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runShellCommand (/home/runner/work/_actions/gr2m/create-or-update-pull-request-action/v1.x/dist/index.js:997:32)
    at async main (/home/runner/work/_actions/gr2m/create-or-update-pull-request-action/v1.x/dist/index.js:758:5) {
  command: 'git push -f ***github.com/dreua/flatpak-module-qpdf-pikepdf.git HEAD:refs/heads/create-or-update-pull-request-action',
  exitCode: 128,
  exitCodeName: 'Unknown system error -128',
  stdout: '',
  stderr: 'remote: Permission to dreua/flatpak-module-qpdf-pikepdf.git denied to github-actions[bot].\n' +
    "fatal: unable to access 'https://github.com/dreua/flatpak-module-qpdf-pikepdf.git/': The requested URL returned error: 403",
  all: 'remote: Permission to dreua/flatpak-module-qpdf-pikepdf.git denied to github-actions[bot].\n' +
    "fatal: unable to access 'https://github.com/dreua/flatpak-module-qpdf-pikepdf.git/': The requested URL returned error: 403",
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  signal: undefined

Note that the tick in "Allow GitHub Actions to create and approve pull requests" is not sufficient, you need the "Read and write permissions" setting. Whether the checkbox needs to be ticket at all needs to be tested, I'm just happy that it works now.

Screenshot from 2023-07-14 19-37-49

@gr2m
Copy link
Owner

gr2m commented Jul 14, 2023

ohhh that is new! Yes, if you could send a pull request to document it, that'd be much apprecaited

@dreua
Copy link
Contributor Author

dreua commented Jul 14, 2023

Actually I didn't offer to make a PR and already spent more time on this then I intended to. If someone else could take care of it, that would be much appreciated, my open source plate is already quite full.

@gr2m gr2m added the good first issue Good for newcomers label Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants