-
-
Save dataflake/f33932efa8fa6423ff2907708664f936 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
#!/bin/sh | |
# | |
# addreleasemanagers.sh Add Release Manager to all active repos | |
# | |
# Uses the "gh" CLI client (https://github.com/cli/cli), | |
# the GitHub REST API | |
# (https://docs.github.com/en/rest?apiVersion=2022-11-28) | |
# and the "jq" JSON processor (https://stedolan.github.io/jq/) via the | |
# "gh" flag "-q" | |
# | |
echo "Adding Release Manager team to repositories" | |
for REPO in $(gh repo list zopefoundation -L 400 --no-archived --json name -q '.[] | .name' | sort); do | |
echo " - ${REPO}" | |
gh api --method PUT -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/zopefoundation/teams/release-managers/repos/zopefoundation/${REPO} -f permission='maintain' | |
sleep 2 | |
done | |
echo "Finished adding Release Manager team to repositories" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment