Last active
October 20, 2018 06:44
-
-
Save coderbyheart/5c86b87405e38ec01149fc8bd34cc52c to your computer and use it in GitHub Desktop.
Batch clone repo containing certain filename
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
GITHUB_USERNAME=coderbyheart | |
ACCESS_TOKEN=`cat ~/.netrc | grep "github.com login $GITHUB_USERNAME" | awk '{ print $6; }'` | |
ORGANIZATION=nrfcloud | |
FILENAME=buildspec.yml | |
# Clone them all | |
curl -u $GITHUB_USERNAME:$ACCESS_TOKEN -s https://api.github.com/search/code\?q=org%3A${ORGANIZATION}+filename%3A$FILENAME | jq ".items[].repository.full_name" -a | xargs -I{} git clone https://github.com/{} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment