GitHubRepoForker
Fork a GitHub repository from an issue URL.
Basic Information
- Type:
haystack_integrations.components.connectors.github.repo_forker.GitHubRepoForker - Components it can connect with:
Input: Receives a GitHub issue URL as input.GitHubFileEditor:GitHubRepoForkersends forked repository and branch to file editor for making changes.GitHubPRCreator: Works alongside to create PRs after forking.
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | str | GitHub issue URL. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| repo | str | Repository path in owner/repo format (the forked repo). | |
| issue_branch | str | Name of the issue-specific branch created in the fork. |
Overview
GitHubRepoForker forks a GitHub repository from an issue URL. It takes a GitHub issue URL, extracts the repository information, creates or syncs a fork of that repository, and optionally creates an issue-specific branch.
This component is useful for building automated pipelines that contribute to repositories, such as automated bug fix systems that fork, make changes, and create pull requests.
Authorization
To use this component, you must create a secret with your GitHub personal access token with permissions to create forks. Type GITHUB_TOKEN as the secret key. For detailed instructions on creating secrets, see Create Secrets.
Usage Example
This pipeline uses GitHubRepoForker to fork a repository and prepare for changes:
components:
GitHubIssueViewer:
type: haystack_integrations.components.connectors.github.issue_viewer.GitHubIssueViewer
init_parameters:
github_token:
type: env_var
env_vars:
- GITHUB_TOKEN
strict: false
raise_on_failure: true
retry_attempts: 2
GitHubRepoForker:
type: haystack_integrations.components.connectors.github.repo_forker.GitHubRepoForker
init_parameters:
github_token:
type: env_var
env_vars:
- GITHUB_TOKEN
strict: true
raise_on_failure: true
wait_for_completion: true
max_wait_seconds: 300
poll_interval: 2
auto_sync: true
create_branch: true
GitHubRepoViewer:
type: haystack_integrations.components.connectors.github.repo_viewer.GitHubRepoViewer
init_parameters:
github_token:
type: env_var
env_vars:
- GITHUB_TOKEN
strict: false
raise_on_failure: true
max_file_size: 1000000
repo:
branch:
connections:
- sender: GitHubRepoForker.repo
receiver: GitHubRepoViewer.repo
- sender: GitHubRepoForker.issue_branch
receiver: GitHubRepoViewer.branch
inputs:
url:
- GitHubIssueViewer.url
- GitHubRepoForker.url
path:
- GitHubRepoViewer.path
outputs:
repo: GitHubRepoForker.repo
issue_branch: GitHubRepoForker.issue_branch
documents: GitHubRepoViewer.documents
max_runs_per_component: 100
metadata: {}
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| github_token | Secret | Secret.from_env_var('GITHUB_TOKEN') | GitHub personal access token for API authentication. |
| raise_on_failure | bool | True | If True, raises exceptions on API errors. |
| wait_for_completion | bool | False | If True, waits until fork is fully created. |
| max_wait_seconds | int | 300 | Maximum time to wait for fork completion in seconds. |
| poll_interval | int | 2 | Time between status checks in seconds. |
| auto_sync | bool | True | If True, syncs fork with original repository if it already exists. |
| create_branch | bool | True | If True, creates a fix branch based on the issue number. |
Run Method Parameters
These are the parameters you can configure for the run() method. You can pass these parameters at query time through the API, in Playground, or when running a job.
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | str | GitHub issue URL. |
Was this page helpful?