Created
March 8, 2016 18:11
-
-
Save dlapiduz/95b0f25830baec95f22b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
repos=$(curl -s "https://api.github.com/search/repositories?q=user:18F+cg-" | jq -r '.items[] | .full_name') | |
for repo in $repos; do | |
echo "Protecting $repo" | |
curl -s "https://api.github.com/repos/$repo/branches/master" \ | |
-XPATCH \ | |
-H "Authorization: token $GH_KEY" \ | |
-H "Accept: application/vnd.github.loki-preview" \ | |
-d '{ | |
"protection": { | |
"enabled": true, | |
"required_status_checks": { | |
"enforcement_level": "everyone", | |
"contexts": [ | |
] | |
} | |
} | |
}' > /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment