Last active
June 25, 2020 21:13
-
-
Save bboughton/6b4b42d3db498188c003f8fda4d497aa 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
#!/usr/bin/env bash | |
# Example of mass adding CODEOWNERS | |
cd $(mktemp -d) | |
set -e | |
cat ~/Desktop/repos.txt | while read repo; do \ | |
git clone git@github.com:infusionsoft/${repo}.git || echo "repo already cloned" | |
pushd ${repo} | |
if [[ -f CODEOWNERS ]]; then | |
echo "CODEOWNERS file already exists" | |
popd | |
continue | |
fi | |
echo '* @infusionsoft/your-team-name' > CODEOWNERS | |
git add CODEOWNERS | |
git commit -m 'Adding CODEOWNERS' | |
git push origin master || { | |
git push origin master:add-codeowners | |
open "https://github.com/infusionsoft/${repo}/pull/new/add-codeowners" | |
} | |
popd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment