-
-
Save KyMidd/e0194ce82883543d0d0d369c2535d65b to your computer and use it in GitHub Desktop.
This file contains 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
# Enable github actions on repo | |
unset CURL | |
CURL=$(curl -s \ | |
-X PUT \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
https://api.github.com/repos/$GH_ORG/$GH_REPO/actions/permissions \ | |
-d '{"enabled":true,"allowed_actions":"selected"}') | |
if [[ $(echo "$CURL" | wc -l) -le 1 ]]; then | |
echo "💥 Successfully set Actions enabled" | |
else | |
echo "☠️ Something bad happened setting actions enable, please investigate response:" | |
echo "$CURL" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment