Can't enable a Github Pages site from the API anymore #35595
-
|
👋 Github folks! Context: we developed our own Github application to build a landing page a Github page site for any repository. Behind the hood, among a lot of different GH API calls, we request the GH API Pages to enable the GH pages site automatically. Problem: It's been working great but for an unknown reason, it stopped working a couple of days ago (maybe 2 weeks?)
Test: the account I used when I installed our GH app on our repository is the admin of the repository so it should have been fine. Another test: Instead of using the token the GH installation generated for me, I also used the "classical" auth token and I received the same error. In that case, I believe it's a permission error under the hood although the error message was the same. For now, we've disabled that functionality and tell our users to enable the GH Pages site manually but I'm curious. Is that a bug or a different behavior/workflow? In that case, what kind of token (and its permission) do I have to ask to my users? Thanks a lot for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
|
Hello, this is a recent security fix. GitHub Apps never had sufficient permission to enable/disable Pages sites (one need to be a repository admin or owner to perform such an operation). While it worked in the past, this was an oversight from our part. The best workaround now if you still need to enable Pages sites programmatically is to leverage PAT. |
Beta Was this translation helpful? Give feedback.
-
|
@yoannchaudet Are there any plans to add this permission to GH Apps? This change has completely broken our Terraform management of repos for our users and we'll have to switch to using a PAT which will hit API rate limits much faster. Was there any advance notice of this security change provided by GitHub? |
Beta Was this translation helpful? Give feedback.
-
|
@yoannchaudet is there an ETA to have this enabled/supported again when authenticating using GitHub Apps ? |
Beta Was this translation helpful? Give feedback.
Hello, this is a recent security fix. GitHub Apps never had sufficient permission to enable/disable Pages sites (one need to be a repository admin or owner to perform such an operation). While it worked in the past, this was an oversight from our part.
The best workaround now if you still need to enable Pages sites programmatically is to leverage PAT.