Github Actions custom deployment protection rule approval not working #144720
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.
-
Select Topic Area
Bug
Body
Hello,
I'm following the documentation here for creating a webhook server that will handle approvals/rejections of deployments in an environment.
I have my code in this gist. It's very messy I'm just trying to get a basic POC running locally using ngrok.
I'm stuck on actually making the approval. It's failing on the POST request to
https://api.github.com/repos/ORG/REPO/actions/runs/RUN_ID/deployment_protection_rule
. I'm getting the following response:This is for a private repo, but we have Github Enterprise so according to the docs here we should have access to all the forms of protection rules on our private repos.
It seems like the whole flow works even though the repos are private. The webhook is firing the way I expect, I just can't figure out why this last part is failing.
I'm suspecting it might be a permissions issue due to a discrepancy between the docs (which are probably geared towards public repositories) and my private repo. I see the following permissions on my installation token:
I see that the installation token is being granted access to the right repository. I'm thinking maybe there's a missing permission so when the request is made, it can't see the protection rule even though I can see it in the UI.
UPDATE
I ported over the code to JavaScript seeing as how this webhook would be implemented in a NextJS app anyways. I have everything set up and I'm getting the same error. This is the webhook code:
This is the error object getting logged:
Beta Was this translation helpful? Give feedback.
All reactions