{"id":27160212,"url":"https://github.com/davibusanello/fork-maintainer","last_synced_at":"2026-05-10T03:17:01.977Z","repository":{"id":286656942,"uuid":"962110134","full_name":"davibusanello/fork-maintainer","owner":"davibusanello","description":"Automated tool to keep your GitHub forks in sync with upstream repositories, featuring scheduled synchronization and detailed sync history tracking.","archived":false,"fork":false,"pushed_at":"2025-07-15T00:17:20.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T04:43:35.841Z","etag":null,"topics":["bun","devops-tools","fork-sync","github-actions","github-api","github-api-rest","github-automation","maintenance-tools","repository-management","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davibusanello.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-07T17:00:38.000Z","updated_at":"2025-07-15T00:17:23.000Z","dependencies_parsed_at":"2025-04-07T18:26:12.054Z","dependency_job_id":"f1bb28c5-6a18-4b79-aa5c-1bfa3cd39ee5","html_url":"https://github.com/davibusanello/fork-maintainer","commit_stats":null,"previous_names":["davibusanello/fork-maintainer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davibusanello/fork-maintainer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davibusanello%2Ffork-maintainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davibusanello%2Ffork-maintainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davibusanello%2Ffork-maintainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davibusanello%2Ffork-maintainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davibusanello","download_url":"https://codeload.github.com/davibusanello/fork-maintainer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davibusanello%2Ffork-maintainer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266586840,"owners_count":23952200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","devops-tools","fork-sync","github-actions","github-api","github-api-rest","github-automation","maintenance-tools","repository-management","typescript"],"created_at":"2025-04-08T23:40:29.065Z","updated_at":"2026-05-10T03:17:01.919Z","avatar_url":"https://github.com/davibusanello.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fork Maintainer\n\n[![Sync Forks Status](https://github.com/davibusanello/fork-maintainer/actions/workflows/sync-forks-with-upstream.yml/badge.svg)](https://github.com/davibusanello/fork-maintainer/actions/workflows/sync-forks-with-upstream.yml)\n\nA utility tool to help maintain and sync your GitHub fork repositories. Currently, it focuses on syncing your fork repositories with their upstream repositories.\n\n## Features\n\n- 🔄 Automatically syncs your fork repositories with their upstream repositories\n- 📝 Keeps track of sync history and results\n- 🔍 Maintains a record of original repositories\n- ⏭️ Provides detailed sync status and error reporting\n\n\u003e **Note**: Initially it was intended to also disable GitHub Actions on forks, but GitHub's API does not support disabling actions for personal repositories. You'll need to disable GitHub Actions manually through the repository settings interface.\n\n**If anyone knows how to do it, please feel free to submit a PR.**\n\n## Prerequisites\n\nChoose one of the following runtimes:\n\n### Bun (Recommended)\n\n- Bun v1.0 or higher (includes native TypeScript support)\n- GitHub Personal Access Token with repository permissions\n\n### Node.js\n\n- Node.js (v23.6 or higher for native TypeScript support)\n- GitHub Personal Access Token with repository permissions\n\n## Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/davibusanello/fork-maintainer.git\n    cd fork-maintainer\n    ```\n\n2. Install dependencies:\n\n    With Bun (recommended):\n\n    ```bash\n    bun install\n    ```\n\n    With Node.js:\n\n    ```bash\n    npm install\n    ```\n\n3. Set up your GitHub token:\n\n    ```bash\n    export GITHUB_TOKEN=your_github_personal_access_token\n    ```\n\n    Or set it in the `.env` file:\n\n    ```bash\n    cp .env.example .env\n    ```\n\n    Then edit the `.env` file:\n\n    ```env\n    GITHUB_TOKEN=your_github_personal_access_token\n    ```\n\n## Usage\n\nRun the script to sync your forks with their upstream repositories:\n\nWith Bun:\n\n```bash\nbun start-sync-forks\n```\n\nWith Node.js:\n\n```bash\nnpm run start-sync-forks\n```\n\nThe script will:\n\n1. Authenticate with GitHub using your token\n2. Find all your fork repositories\n3. Sync each fork with its upstream repository\n4. Keep track of sync history in `storage/synced-forks-history.json`\n\n## Configuration\n\nYou must configure a repository secret named `GH_PERSONAL_ACCESS_TOKEN` with your GitHub Personal Access Token with access to other repositories.\n\nThe script uses the following environment variables:\n\n- `GITHUB_TOKEN`: Your GitHub Personal Access Token (required)\n\n## GitHub Action Setup\n\nThe project includes a GitHub Action that automatically syncs your forks every 2 days. To set it up:\n\n1. Generate a Fine-grained Personal Access Token:\n   - Go to GitHub Settings \u003e Developer settings \u003e Personal access tokens \u003e Fine-grained tokens\n   - Click \"Generate new token\"\n   - Configure the token:\n     - Token name: \"Fork Maintainer\"\n     - Expiration: Choose your preferred duration (recommended: 1 year)\n     - Resource owner: Your GitHub username or organization\n     - Repository access: Select \"All repositories\" (needed to access all your forks)\n     - Permissions:\n       - Repository permissions:\n         - Contents: Read and write (to sync forks and update history)\n         - Workflow: Read and write (to update the history file)\n         - Metadata: Read-only (required for repository information)\n         - Actions: Read-only (to check workflow status)\n         - Administration: Read-only (to check fork relationships)\n   - Click \"Generate token\"\n   - Copy the generated token\n\n2. Add the token as a repository secret:\n   - Go to your fork-maintainer repository\n   - Navigate to Settings \u003e Secrets and variables \u003e Actions\n   - Click \"New repository secret\"\n   - Name: `GH_PERSONAL_ACCESS_TOKEN`\n   - Value: Paste your generated token\n   - Click \"Add secret\"\n\n3. The GitHub Action will now:\n   - Run automatically every 2 days at midnight UTC\n   - Can be triggered manually from the Actions tab\n   - Keep your forks in sync with their upstream repositories\n   - Maintain a history of syncs in `storage/synced-forks.json`\n\nYou can view the sync results in the Actions tab of your repository.\n\n### Customizing the Schedule\n\nThe default schedule runs every 2 days. To change this, modify the cron expression in `.github/workflows/sync-forks-with-upstream.yml`:\n\n```yaml\non:\n  schedule:\n    - cron: '0 0 */2 * *'  # Runs every 2 days at midnight UTC\n  workflow_dispatch:        # Allows manual triggers\n```\n\nCommon cron examples:\n\n- Daily: `0 0 * * *`\n- Weekly: `0 0 * * 0`\n- Monthly: `0 0 1 * *`\n\n## Project Structure\n\n```text\n.\n├── src/\n│   └── sync-forks.ts          # Main script for syncing forks with upstream\n│   └── actions-disabler.ts    # Main script for disabling GitHub Actions (Not working)\n├── storage/                   # Directory for storing sync history data\n├── .github/                   # GitHub specific configurations\n├── LICENSE                    # MIT License\n└── README.md                  # This file\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavibusanello%2Ffork-maintainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavibusanello%2Ffork-maintainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavibusanello%2Ffork-maintainer/lists"}