SIGN IN SIGN UP

Add branch protection support for `required_status_checks.checks` object (#2884)

as outlined in
https://github.com/PyGithub/PyGithub/pull/2873#issuecomment-1906795864:
> Looking at the
[docs](https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#update-branch-protection)
I found that argument `required_status_checks.contexts` is deprecated in
the API and replaced by `required_status_checks.checks`.

I've done:
- [x] adds `checks` as another argument
- [x] `checks` should be of type `List[Union[str, Tuple[str, int]]]` so
that this allows for `checks=["check1", ("check2", -1), ("check3",
123456)]`
- [x] if only `context` is given, it's values should be used to populate
`required_status_checks.checks.context`, rather than
`required_status_checks.contexts`
- [x] if both `checks` and `context` are given, `context` should be
ignored

Fixes #2157

---------

Co-authored-by: Enrico Minack <github@enrico.minack.dev>
B
Benjamin K. committed
764540d34cc44368f535dd59cfe180d2e76d8ef5
Parent: 8ed5635
Committed by GitHub <noreply@github.com> on 12/17/2024, 5:47:56 PM