Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created November 20, 2022 18:58
Show Gist options
  • Save KyMidd/e0194ce82883543d0d0d369c2535d65b to your computer and use it in GitHub Desktop.
Save KyMidd/e0194ce82883543d0d0d369c2535d65b to your computer and use it in GitHub Desktop.
# 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