Closed as not planned
Description
Hi,
In my use case, I do git push
from GitHub Actions workflows to master
branches.
I have branch protection rules on master
, so as part of the workflow I first disable the enforce_admins
setting, then git push
, and finally enable enforce_admins
.
I modify enforce_admins
as follows:
curl -X DELETE -u USER:TOKEN https://api.github.com/repos/ORGANIZATION/REPOSITORY/branches/master/protection/enforce_admins
curl -X POST -u USER:TOKEN https://api.github.com/repos/ORGANIZATION/REPOSITORY/branches/master/protection/enforce_admins
Is it something that can be added to the action?
So that if the action tries to push, and gets a protected branch hook declined
response, it'll try to disable enforce_admins
, push again, and reenable enforce_admins
at the end.