Skip to content

Commit

Permalink
Add 'make update-github-branch-protection-rules'
Browse files Browse the repository at this point in the history
This is pretty terrible, and it uses the deprecated 'contexts' instead
of the 'checks', but the API has an endpoint for setting just contexts,
and it doesn't have an endpoint for setting checks.
  • Loading branch information
mgedmin committed Oct 9, 2024
1 parent 6cd3e45 commit 457a087
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,54 @@ isort: ##: check for incorrect import ordering
mypy: ##: check for type errors
tox -e mypy

##: GitHub maintenance

.PHONY: update-github-branch-protection-rules

update-github-branch-protection-rules: ##: update GitHub branch protection rules
gh api -X PUT -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/mgedmin/check-manifest/branches/master/protection/required_status_checks/contexts \
-f "contexts[]=check-manifest" \
-f "contexts[]=check-python-versions" \
-f "contexts[]=flake8" \
-f "contexts[]=isort" \
-f "contexts[]=mypy" \
-f "contexts[]=Python 3.7, bzr" \
-f "contexts[]=Python 3.7, git" \
-f "contexts[]=Python 3.7, hg" \
-f "contexts[]=Python 3.7, svn" \
-f "contexts[]=Python 3.8, bzr" \
-f "contexts[]=Python 3.8, git" \
-f "contexts[]=Python 3.8, hg" \
-f "contexts[]=Python 3.8, svn" \
-f "contexts[]=Python 3.9, bzr" \
-f "contexts[]=Python 3.9, git" \
-f "contexts[]=Python 3.9, hg" \
-f "contexts[]=Python 3.9, svn" \
-f "contexts[]=Python 3.10, bzr" \
-f "contexts[]=Python 3.10, git" \
-f "contexts[]=Python 3.10, hg" \
-f "contexts[]=Python 3.10, svn" \
-f "contexts[]=Python 3.11, bzr" \
-f "contexts[]=Python 3.11, git" \
-f "contexts[]=Python 3.11, hg" \
-f "contexts[]=Python 3.11, svn" \
-f "contexts[]=Python 3.12, bzr" \
-f "contexts[]=Python 3.12, git" \
-f "contexts[]=Python 3.12, hg" \
-f "contexts[]=Python 3.12, svn" \
-f "contexts[]=Python 3.13, bzr" \
-f "contexts[]=Python 3.13, git" \
-f "contexts[]=Python 3.13, hg" \
-f "contexts[]=Python 3.13, svn" \
-f "contexts[]=Python pypy3.10, bzr" \
-f "contexts[]=Python pypy3.10, git" \
-f "contexts[]=Python pypy3.10, hg" \
-f "contexts[]=Python pypy3.10, svn" \
-f "contexts[]=continuous-integration/appveyor/branch" \
-f "contexts[]=continuous-integration/appveyor/pr"

##: Releasing

.PHONY: distcheck
Expand Down

0 comments on commit 457a087

Please sign in to comment.