Skip to content

Unable to Push to Protected Branch with WIP Status Check Enabled #770

@vicentepdj

Description

@vicentepdj

I am encountering an issue where I am unable to push to a protected branch (dev) in my repository when the WIP status check is enabled. The commit message does not include "WIP", but I still receive an error indicating that the branch update failed due to the WIP status check.
The user (user1) has write privileges and the protection rule is configured so that this user is able to push to this branch even though is protected for the rest of the users.

Steps to Reproduce:

  1. Configure branch protection rules with the following options checked:
    1.1 Required a pull request before merging
    1.2 Require approvals (1)
    1.3 Restrict who can dismiss pull request reviews -> (user1)
    1.4 Allow specified actors to bypass required pull request -> (user1)
    1.5 Require status checks to pass before merging (WIP)
    1.6 Require approval of the most recent reviewable push
    1.7 Require linear history
    1.8 Restrict who can push to matching branches -> (user1)
  2. Ensure the commit message does not contain "WIP".
  3. Attempt to push changes directly to the dev branch.

Expected Behavior: The push should succeed if the commit message does not contain "WIP".

Actual Behavior: The push fails with the following error message:

remote: error: GH006: Protected branch update failed for refs/heads/dev.
remote: 
remote: - Changes must be made through a pull request.
remote: 
remote: - Required status check "WIP" is expected.

If I disable the check e I can push directly to the branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions