Git Trees API returns 404 instead of 403 when workflow scope is missing for .github/workflows/* files #188829
Replies: 1 comment
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
When using the Git Data API's Create a tree endpoint (
POST/repos/{owner}/{repo}/git/trees) with a classic OAuth token that hasreposcope but notworkflowscope, and the tree includes entries under.github/workflows/, the API returns 404 Not Found instead of 403 Forbidden.This is extremely misleading and difficult to debug because:
X-Accepted-OAuth-Scopesheader on the 404 response is empty, providing no hint about the requiredworkflowscope
Steps to reproduce
scope=repo(noworkflowscope)POST /user/reposwithauto_init: truePOST /repos/{owner}/{repo}/git/blobs— succeedsPOST /repos/{owner}/{repo}/git/treeswith an entry whosepathis.github/workflows/deploy.yml— returns 404Request
Response
Expected behavior
The API should return 403 Forbidden with a message indicating that the workflow scope is required to create or modify files under .github/workflows/. Ideally, the X-Accepted-OAuth-Scopes header should include workflow.
Beta Was this translation helpful? Give feedback.
All reactions