Last active
October 27, 2017 15:27
-
-
Save jkribeiro/d3f8ebd8702eb960d127174c7a14b1fd to your computer and use it in GitHub Desktop.
Script to push a blank commit to a list of repositories and branches.
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/bash | |
GITHUB_ORG="<org>" | |
REPOS=" | |
<repoA> | |
<repoB> | |
" | |
BRANCHES=" | |
<branchA> | |
<branchB> | |
<branchC> | |
" | |
# Iterate repos. | |
for repo in `echo ${REPOS}`; do | |
# Clone repo. | |
echo "Cloning ${repo}" | |
git clone "[email protected]:${GITHUB_ORG}/${repo}.git" | |
cd "${repo}" | |
# Iterate branches. | |
for branch in `echo ${BRANCHES}`; do | |
# Chekout branch. | |
git checkout "${branch}" | |
# Trigger blank commit. | |
git commit --allow-empty -m "Trigger notification" | |
# Push commit. | |
git push origin "${branch}" | |
done | |
# Remove repo. | |
cd .. | |
rm -rf "${repo}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment