Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle new GitHub branch_protection API
Fixes sigmavirus24#1112 Since ~Q1 2022, branch_protection has an additional "checks" field which deprecates "contexts": "contexts": list[str] "checks": list[TypedDict("checks", context=str, app_id=int | None)] The GitHub API returns both and then errors if both are present on update. So, when making unrelated changes, check whether both are present and if so remove the "contexts" field, on the assumption that "checks" contains all the same data plus possibly app_id fields that we should not overwrite with nil. Does this look OK? Happy to add polish, tests etc. if it's the right approach.
- Loading branch information