Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created July 27, 2024 03:29
Show Gist options
  • Save KyMidd/96508f382d926c070021659be8ddb9b9 to your computer and use it in GitHub Desktop.
Save KyMidd/96508f382d926c070021659be8ddb9b9 to your computer and use it in GitHub Desktop.
unset CURL
CURL=$(curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/user/installations/$GITHUB_APP_INSTALLATION_ID/repositories/$GH_REPO_ID" 2>&1 \
)
# Check for errors
if [[ $(echo "$CURL" | grep -E 'Not Found') ]]; then
echo "☠️ Something bad happened adding $GH_REPO to Gitub App, please investigate response:"
echo "$CURL"
else
echo "💥 Successfully added $GH_REPO ($CURRENT_REPO_COUNT/$ALL_REPOS_COUNT) to GitHub App w/ ID $GITHUB_APP_INSTALLATION_ID"
fi
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment