Move scanner outputs out of repo root

This commit is contained in:
root 2026-05-05 01:18:10 +00:00
parent 14d1b566d6
commit f59fcc58b1
4 changed files with 13 additions and 4 deletions

2
.gitignore vendored
View File

@ -31,8 +31,10 @@ Thumbs.db
# Local environment and secret-bearing files
.env
*.env
accounts.json
# Generated outputs and local data caches
supabase monitor/output/
youtube/captions/
github_repo_scanners/contributor_repos/
github_repo_scanners/user_repos/

View File

@ -85,6 +85,7 @@ Key files:
- `create_user_repo_lists.sh`
- `create_contributor_repo_lists.sh`
- `run_contributor_json_creation.sh`
- `user_repos/`
- `contributor_repos/*.json`
### `Slack Message/`

View File

@ -57,6 +57,8 @@ This directory (`github_repo_scanners`) contains scripts for more advanced repos
This script scans all accounts in `accounts.json` and creates a JSON file for each user containing a list of repositories they have access to.
Output files are written under `github_repo_scanners/user_repos/`.
**Command:**
```bash
./github_repo_scanners/create_user_repo_lists.sh <path_to_accounts.json>
@ -71,6 +73,8 @@ This script scans all accounts in `accounts.json` and creates a JSON file for ea
This script scans all accounts in `accounts.json`, finds all contributors to their repositories, and creates a JSON file for each contributor listing the repositories they have contributed to.
The wrapper `run_contributor_json_creation.sh` writes those files under `github_repo_scanners/contributor_repos/`.
**Command:**
```bash
./github_repo_scanners/create_contributor_repo_lists.sh <path_to_accounts.json>

View File

@ -1,6 +1,7 @@
#!/bin/bash
ACCOUNTS_FILE="accounts.json"
OUTPUT_DIR="github_repo_scanners/user_repos"
# Check if accounts.json exists
if [ ! -f "$ACCOUNTS_FILE" ]; then
@ -8,6 +9,8 @@ if [ ! -f "$ACCOUNTS_FILE" ]; then
exit 1
fi
mkdir -p "$OUTPUT_DIR"
# Loop through each account in accounts.json
jq -c '.[]' "$ACCOUNTS_FILE" | while read -r account; do
USER=$(echo "$account" | jq -r '.user')
@ -18,10 +21,9 @@ jq -c '.[]' "$ACCOUNTS_FILE" | while read -r account; do
# Get all repos the user has access to (owner, collaborator, org member)
# and format the output as a JSON array.
curl -s -H "Authorization: token $TOKEN" "https://api.github.com/user/repos?type=all&per_page=100" | \
jq -r '[.[] | .full_name]' > "${USER}.json"
jq -r '[.[] | .full_name]' > "${OUTPUT_DIR}/${USER}.json"
echo "Successfully created ${USER}.json"
echo "Successfully created ${OUTPUT_DIR}/${USER}.json"
done
echo "All user repository lists have been created."
echo "All user repository lists have been created in '${OUTPUT_DIR}'."