Skip to content

Support Disabling\Enabling enforce_admins As Part of Push #508

Closed as not planned
@GreasyAvocado

Description

@GreasyAvocado

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: pendingMore info is needed before deciding what to do

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions