GitAgent avatar
GitAgent

Pricing

Pay per usage

Go to Store
GitAgent

GitAgent

Developed by

Yossi Elkrief

Maintained by Community

**Tired of manually syncing your open-source repos?** Let our powerful agent handle it for you! Just enter the details, and it will automatically sync all your repos with their corresponding parent repos—keeping them up-to-date with the latest code, effortlessly. 🚀

0.0 (0)

Pricing

Pay per usage

0

Monthly users

2

Runs succeeded

>99%

Last modified

a month ago

GitHub Fork Updater

An Apify actor that automatically updates your forked GitHub repositories to sync with their upstream repositories. This actor supports both GitHub API and browser automation approaches.

Features

  • Automatically detects and updates all forked repositories for a given GitHub user
  • Supports both GitHub API and browser automation methods
  • Rate limiting and concurrency control to avoid API limits
  • Detailed logging of all operations
  • Configurable execution parameters
  • Comprehensive error handling with retry logic for transient errors
  • Detailed dataset output with sync results for each repository

Input Configuration

The actor accepts the following input parameters:

1{
2    "githubToken": "your-github-token",
3    "targetUsername": "your-github-username",
4    "useGithubApi": true,
5    "maxConcurrency": 3
6}
ParameterTypeRequiredDefaultDescription
githubTokenstringYes-GitHub personal access token with repo scope
targetUsernamestringYes-GitHub username whose forks need to be updated
useGithubApibooleanNotrueWhether to use GitHub API (true) or browser automation (false)
maxConcurrencynumberNo3Maximum number of concurrent repository updates

GitHub Token Setup

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Generate a new token with the repo scope
  3. Copy the token and use it in the actor input

Usage

  1. Create a new task in Apify Console
  2. Set up the input configuration according to your needs
  3. Run the task

The actor will:

  1. Authenticate with GitHub
  2. Fetch all repositories for the target user
  3. Filter for forked repositories
  4. Update each fork with changes from its upstream repository
  5. Log the results of each operation
  6. Store detailed results in the actor's dataset

Dataset Output

The actor stores detailed information about each repository sync operation in its dataset. Each record includes:

1{
2    "repository_name": "username/repo-name",
3    "timestamp": "2023-02-09T10:00:00.000Z",
4    "sync_status": true|false,
5    "error": "Error message (only present if sync_status is false)"
6}

You can access this dataset in the Apify Console after the actor run completes, or programmatically using the Apify API.

Implementation Details

The actor provides two methods for updating forks:

  • Uses the official GitHub REST API via Octokit
  • Faster and more reliable
  • Subject to API rate limits
  • More efficient resource usage
  • Implements retry logic with exponential backoff for transient errors

Browser Automation Method

  • Uses Puppeteer for browser automation
  • More resilient to API changes
  • Can handle cases where API access is limited
  • Slower than the API method
  • Implements multiple authentication strategies for reliability

Authentication Methods

The actor supports multiple authentication methods:

  1. GitHub API Authentication: Uses the GitHub token directly with the Octokit client
  2. Browser Authentication:
    • First attempts token-based authentication via localStorage
    • Falls back to API-based authentication if needed
    • Includes verification steps to ensure successful authentication

Error Handling

The actor implements comprehensive error handling:

  • Individual repository failures don't stop the entire process
  • Rate limiting is handled automatically with exponential backoff
  • Transient errors are retried with increasing delays
  • All errors are logged for debugging
  • Error details are stored in the dataset output
  • Cleanup is performed even if errors occur

Limitations

  • GitHub API rate limits apply
  • Browser automation may break if GitHub's UI changes
  • Token must have appropriate permissions
  • Large numbers of forks may take time to process

Pricing

Pricing model

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.