-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a4f88e
commit 8aa556d
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
set -e -o pipefail | ||
|
||
# Lists all repos tagged with "pattern" in the two organizations: | ||
# - validatedpatterns | ||
# - validatedpatterns-sandbox | ||
|
||
ORGS=("validatedpatterns" "validatedpatterns-sandbox") | ||
TOPIC=${TOPIC:-pattern} | ||
BASE=${BASE:-/tmp/pattern} | ||
|
||
mkdir -p "${BASE}" || /bin/true | ||
|
||
for org in ${ORGS[@]}; do | ||
REPOS=$(gh repo list "${org}" --no-archived --topic "${TOPIC}" --visibility public --limit 100 |awk '{ print $1 }' | sort) | ||
ret=$? | ||
if [ ${ret} -ne 0 ]; then | ||
echo "Error retrieving pattern list for ${org}" | ||
exit ${ret} | ||
fi | ||
while IFS= read -r repo; do | ||
echo "Cloning: ${repo} into ${BASE}/${repo}" | ||
mkdir -p "${BASE}/${org}" || /bin/true | ||
pushd "${BASE}/${org}" | ||
git clone [email protected]:${repo} | ||
pushd "${BASE}/${repo}" | ||
git checkout -b "scripted-changes" | ||
popd | ||
popd | ||
done <<< "$REPOS" | ||
done |