octocrab icon indicating copy to clipboard operation
octocrab copied to clipboard

422 Status code when updating commit on Github Enterprise Server

Open Pepiloto opened this issue 1 year ago • 3 comments

When I try to update a file on a repo using : octokit.repos().update_file().send() I get a 422 status code.

I'm on a Github Enterprise Server and using a Github App.

422 should be "Validation failed, or the endpoint has been spammed." according to the documentation (https://docs.github.com/en/[email protected]/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents)

But on my hand I don't "spam" the endpoint and on the other github app in Typescript we use the same endpoint and we don't have this returning status code.

Pepiloto avatar Sep 13 '24 08:09 Pepiloto

Thank you for your issue! I don't have access to GitHub enterprise so I couldn't say. But I will accept a PR if someone can provide a fix :)

XAMPPRocky avatar Sep 13 '24 08:09 XAMPPRocky

Is there a way to log requests made with octocrab so I can look for the content of it ?

Pepiloto avatar Sep 13 '24 08:09 Pepiloto

Octocrab uses tower so you could create a custom http client with a logger.

XAMPPRocky avatar Sep 13 '24 09:09 XAMPPRocky