Skip to content

Instantly share code, notes, and snippets.

@dlapiduz
Created March 8, 2016 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlapiduz/95b0f25830baec95f22b to your computer and use it in GitHub Desktop.
Save dlapiduz/95b0f25830baec95f22b to your computer and use it in GitHub Desktop.
#!/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