A GitHub Actions workflow that syncs all forked repositories in your account with their upstream sources daily.
- Runs daily at 06:00 UTC (configurable)
- Lists all forks in your GitHub account (handles pagination for large accounts)
- Syncs every branch that tracks an upstream branch, not just the default branch
- Handles GitHub API rate limits with automatic backoff
- Logs successes and failures per repo/branch
-
Push this repository to your GitHub account.
-
Create a GitHub Personal Access Token (classic) with
public_repoandmodels:readscopes:- Go to Settings > Developer settings > Personal access tokens > Tokens (classic)
- Click Generate new token (classic)
- Select the
public_reposcope (for repo access) - Select the
models:readscope (for AI failure resolver) - Copy the token
-
Add the token as a repository secret:
- Go to this repo's Settings > Secrets and variables > Actions
- Click New repository secret
- Name:
SYNC_TOKEN - Value: paste your PAT
-
The workflow runs automatically on schedule. To trigger manually:
- Go to Actions > Sync All Forks > Run workflow
GitHub allows 5,000 API requests per hour for authenticated users. With ~2,700 forks, a full sync uses roughly 2,700–5,000 requests depending on branch counts. The script includes rate-limit detection and will pause/resume automatically if the limit is hit.
A second workflow (resolve-failures.yml) runs daily at 07:30 UTC and:
- Scans all repos across
Interested-Deving-1896,OpenOS-Project-OSP, andOpenOS-Project-Ecosystem-OOC - Finds failed workflow runs
- Fetches job logs and the workflow YAML file
- Sends them to GitHub Models (GPT-4o-mini) for analysis
- Auto-commits fixes when the AI produces a valid correction
To trigger manually: Actions > Resolve CI Failures > Run workflow
The SYNC_TOKEN PAT needs models:read scope for AI access.
If a fork branch has diverged from upstream (local commits exist), the sync for that branch will fail gracefully. These are logged as warnings so you can resolve them manually.