github-api icon indicating copy to clipboard operation
github-api copied to clipboard

GHBranchProtection using deprecated field in required_status_checks

Open jrarmstro opened this issue 3 years ago • 0 comments

Describe the bug

GHBranchProtection is using the contexts field in RequiredStatusChecks. This field was deprecated in GitHub 3.0.

contexts(array of strings) | Required. Deprecated: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use checks instead of contexts for more fine-grained control.

As a result, repositories using App-authorized checks may experience surprising behaviour if two or more GitHub Apps are posting to the same check and a branch protection rule is (re)created.

To Reproduce

Create a branch protection rule with the API which requires one or more checks. Submit the required check from multiple GitHub Apps. Merging is blocked for one of the Apps.

image

Expected behavior

Checks can come from any PAT or GitHub App by default.

The new checks array should be passed to allow configuration of the required GitHub App for a check.

jrarmstro avatar Jun 01 '22 20:06 jrarmstro