Skip to content

Commit

Permalink
📝 docs(README.md): add EXCLUDED_ORG environment variable to exclude s…
Browse files Browse the repository at this point in the history
…pecific organization from cloning process

🐛 fix(cloner.sh): use EXCLUDED_ORG environment variable to exclude specific organization from cloning process
  • Loading branch information
0xjesus committed Jan 29, 2024
1 parent a783d29 commit 337e929
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This script automates the task of cloning all your personal GitHub repositories
```
GITHUB_TOKEN=your_github_token
GITHUB_USER=your_github_username
EXCLUDED_ORG=excluded_organization
```
2. Ensure the script is executable:
```bash
Expand Down
2 changes: 1 addition & 1 deletion cloner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/users/$G
echo "Cloning organization repositories..."
ORGANIZATIONS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/user/orgs" | jq -r ".[].login")
for org in $ORGANIZATIONS; do
if [ "$org" != "venveo" ]; then
if [ "$org" != "$EXCLUDED_ORG" ]; then
echo "Cloning repositories of the organization $org..."
curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/orgs/$org/repos?per_page=100" | jq -r ".[].name" | while read repo; do clone_repo $repo $org; done
else
Expand Down

0 comments on commit 337e929

Please sign in to comment.