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

REST API endpoints for pull requests should mention Allow GitHub Actions to create and approve pull requests #36525

Closed
1 task done
jsoref opened this issue Feb 26, 2025 · 5 comments
Labels
content This issue or pull request belongs to the Docs Content team fix-internally Triggers a workflow to copy the issue internally and close the current issue

Comments

@jsoref
Copy link
Contributor

jsoref commented Feb 26, 2025

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request

What part(s) of the article would you like to see updated?

Add a subsection github-actions

Possibly that just links to https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests

Additional information

GitHub workflows that use gh pr ... or the api equivalent trigger this error:

{
  "message": "GitHub Actions is not permitted to create or approve pull requests.",
  "documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request",
  "status": "403"
}

Which points to the above document but the above document makes no mention of this knob.

@jsoref jsoref added the content This issue or pull request belongs to the Docs Content team label Feb 26, 2025
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Feb 26, 2025
@subatoi
Copy link
Contributor

subatoi commented Feb 26, 2025

Thanks for raising this, @jsoref

Before I triage it: just to run it by you, would it make more sense for the error message to return a link to https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests instead of https://docs.github.com/rest/pulls/pulls#create-a-pull-request ?

@jsoref
Copy link
Contributor Author

jsoref commented Feb 26, 2025

@subatoi oh, yeah, I think so. As you already know that the user is GitHub-actions and that it has generic pull-requests: write, sending to that doc makes way more sense!

Certainly, if you're willing to special case the error message, that'd be great. Thinking about how the code has to work, it really should already be in a special case, so, yes please!

@jsoref
Copy link
Contributor Author

jsoref commented Feb 26, 2025

Note that that the doc might need some adjusting to say "if you were directed here by an error, it's because you need to toggle this feature or use a dedicated account instead".

@github github deleted a comment from ashik40472 Feb 27, 2025
@github github deleted a comment from MalikNadirawan Feb 27, 2025
@github github deleted a comment from MalikNadirawan Feb 27, 2025
@subatoi
Copy link
Contributor

subatoi commented Feb 27, 2025

Just to set expectations appropriately, I can only make recommendations about the error message, but either way I agree this could be improved. Since it relates to the REST docs, I'm going to transfer this to an internal issue (all of the comments here will be noted). If it's feasible to change the error message URL—it might need to be shortened—I'll make that recommendation, but otherwise I agree we could look at adding a section here instead, per your original recommendation.

Many thanks for bringing this to our attention

@subatoi subatoi added fix-internally Triggers a workflow to copy the issue internally and close the current issue and removed triage Do not begin working on this issue until triaged by the team labels Feb 27, 2025
@docs-bot
Copy link
Collaborator

Thank you for opening this issue! Updates to this documentation must be made internally. I have copied your issue to an internal issue, so I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team fix-internally Triggers a workflow to copy the issue internally and close the current issue
Projects
None yet
Development

No branches or pull requests

3 participants