1
0
mirror of synced 2025-12-19 18:14:56 -05:00

Admin approve and merge

This commit is contained in:
Ben Church
2023-12-01 14:47:36 -08:00
parent 5f5295ee9a
commit 262f93dde5
2 changed files with 67 additions and 0 deletions

19
tools/bin/get_repo_admins.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <personal_access_token> <repository>"
exit 1
fi
# Assign arguments to variables
TOKEN="$1"
REPO="$2"
# GitHub API URL for repository collaborators
API_URL="https://api.github.com/repos/$REPO/collaborators"
# Curl command to get the list of collaborators with admin rights
curl -H "Authorization: token $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"$API_URL" | jq '.[] | select(.permissions.admin == true) | "[\(.login)](\(.html_url))"' | tr -d '"' | paste -sd "\\n" -