GH API to update branch permissions #24758
-
I am trying to update a branch permission by using gh apis. I authenticated my gh terminal using However, when I am trying to update branch permissions, I am seeing Invalid request errors. I tried running the same using curl and this request is successful. How do I replicate the same using gh api?
This is what I have come up with thus far (I tried putting in the same body as above but that was failing as well):
and the error I am seeing looks like this.
Any help on how to send the right request through gh api would be really helpful. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This post helped me answer my question. So, I had to pass in the array object as input as opposed to the field value (as that cannot take array values currently) Something like this worked for me:
|
Beta Was this translation helpful? Give feedback.
-
Something like this might also work
|
Beta Was this translation helpful? Give feedback.
-
Yep! @ydorbala 's solution above works for me too!
FYI: because I struggled with this, this is how we can disable branch protection programmatically (set it to null)
|
Beta Was this translation helpful? Give feedback.
This post helped me answer my question. So, I had to pass in the array object as input as opposed to the field value (as that cannot take array values currently)
Something like this worked for me: