mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-01 13:18:10 +00:00
* feat: adopt directory-based docs versioning with Edge channel Switch docs.crewai.com from navigation-only versioning (every version selector entry rendered the same docs/<lang>/* source files) to Mintlify's directory-based versioning so each version selector entry renders its own snapshot. Add an "Edge" channel under docs/edge/<lang>/* that always reflects main HEAD for unreleased work, eliminating pre-release leakage onto frozen release labels. External links to canonical /<lang>/* URLs are preserved via wildcard redirects that always land on the current default version. Layout: - docs/edge/<lang>/* rolling source (you edit here) - docs/edge/enterprise-api.*.yaml - docs/v<X.Y.Z>/<lang>/* frozen, immutable snapshots - docs/v<X.Y.Z>/enterprise-api.*.yaml - docs/images/ shared, append-only - docs/docs.json nav + redirects URLs follow the Mintlify-idiomatic shape: /edge/<lang>/<page> for Edge, /v<X.Y.Z>/<lang>/<page> for every frozen snapshot. The wildcard redirects /<lang>/:slug* -> /<default>/<lang>/:slug* keep stale links working, and every freeze rewrites them (plus all per-section/per-page redirects) so destinations always resolve to the current default without depending on a second redirect hop. Release flow integration (devtools release): - New module crewai_devtools.docs_versioning.freeze() materialises docs/v<X.Y.Z>/ from docs/edge/, rewrites openapi: refs inside the snapshot, inserts the version into every language block in docs.json, and refreshes all redirect destinations. - _update_docs_and_create_pr() in cli.py now calls that freeze during Phase 2 of devtools release. Edge changelogs are updated first (so the snapshot freeze picks them up), then the snapshot is staged alongside docs.json, branched as docs/freeze-v<X.Y.Z>, and the PR is titled [docs-freeze] docs: snapshot and changelog for v<X.Y.Z> — the title prefix the new CI guard reads. - The PR still gates tag, GitHub release, PyPI publish, and the enterprise release as before; no new PRs are added. - Pre-releases (1.X.YaN, 1.X.YbN, ...) skip the snapshot — they ride Edge — and the docs PR title omits the [docs-freeze] prefix. - docs_check (AI-generated docs scaffolding) writes to docs/edge/<lang>/* so newly-generated unreleased docs land in Edge and never accidentally touch a frozen snapshot. Migration scripts (one-shot): - scripts/docs/freeze_historical_versions.py reconstructs all 16 historical snapshots (v1.10.0 .. v1.14.7) from git tags via git archive | tar, rewriting openapi: MDX refs so each snapshot reads its own enterprise-api YAML rather than the live one. - scripts/docs/prefix_version_paths.py one-shot-migrates docs.json: rewrites every page path in 16 versioned blocks to point under docs/v<X.Y.Z>/, inserts a new Edge entry per language, tags v1.14.7 as Latest (default), prunes pages whose target file doesn't exist in the snapshot (e.g. docs/ar/ didn't exist before v1.12.0), and writes the wildcard + per-section redirects. - scripts/docs/freeze_current_edge.py is now a thin CLI wrapper around docs_versioning.freeze for manual one-off freezes (e.g. retroactively snapshotting a forgotten release). CI guards (.github/workflows/docs-snapshots.yml): - Frozen snapshots under docs/v[0-9]*/ are immutable; only PRs whose title contains [docs-freeze] (i.e. release-cut PRs generated by devtools release or the manual wrapper) may modify them. - Images under docs/images/ are append-only since snapshots share a single image directory. Deleting or renaming an image breaks every historical snapshot that still references it. Restored docs/images/crewai-otel-export.png from PR #3673; it was deleted in PR #4908 but v1.10.0 / v1.10.1 snapshots still reference it. Restoring instead of editing the snapshots preserves historical rendering fidelity and validates the new append-only rule retroactively. Tests: - lib/devtools/tests/test_docs_versioning.py covers the freeze: file copy, openapi rewrite, version insertion, default demotion, redirect upserts, per-section redirect rewriting, idempotency, and invalid inputs. Verified locally with mintlify broken-links: 0 broken links across the full site (Edge + 16 frozen versions, 4 locales). AGENTS.md (repo root) is the contributor guide for the new model; RELEASING.md is the release-cut runbook; README's Contribution section links to both. Co-authored-by: Cursor <cursoragent@cursor.com> * style: resolve linter issues --------- Co-authored-by: Cursor <cursoragent@cursor.com>
332 lines
13 KiB
Plaintext
332 lines
13 KiB
Plaintext
---
|
|
title: GitHub Integration
|
|
description: "Repository and issue management with GitHub integration for CrewAI."
|
|
icon: "github"
|
|
mode: "wide"
|
|
---
|
|
|
|
## Overview
|
|
|
|
Enable your agents to manage repositories, issues, and releases through GitHub. Create and update issues, manage releases, track project development, and streamline your software development workflow with AI-powered automation.
|
|
|
|
## Prerequisites
|
|
|
|
Before using the GitHub integration, ensure you have:
|
|
|
|
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
|
- A GitHub account with appropriate repository permissions
|
|
- Connected your GitHub account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
|
|
|
## Setting Up GitHub Integration
|
|
|
|
### 1. Connect Your GitHub Account
|
|
|
|
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
|
2. Find **GitHub** in the Authentication Integrations section
|
|
3. Click **Connect** and complete the OAuth flow
|
|
4. Grant the necessary permissions for repository and issue management
|
|
5. Copy your Enterprise Token from [Integration Settings](https://app.crewai.com/crewai_plus/settings/integrations)
|
|
|
|
### 2. Install Required Package
|
|
|
|
```bash
|
|
uv add crewai-tools
|
|
```
|
|
|
|
### 3. Environment Variable Setup
|
|
|
|
<Note>
|
|
To use integrations with `Agent(apps=[])`, you must set the
|
|
`CREWAI_PLATFORM_INTEGRATION_TOKEN` environment variable with your Enterprise
|
|
Token.
|
|
</Note>
|
|
|
|
```bash
|
|
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
|
|
```
|
|
|
|
Or add it to your `.env` file:
|
|
|
|
```
|
|
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
|
|
```
|
|
|
|
## Available Actions
|
|
|
|
<AccordionGroup>
|
|
<Accordion title="github/create_issue">
|
|
**Description:** Create an issue in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
|
- `title` (string, required): Issue Title - Specify the title of the issue to create.
|
|
- `body` (string, optional): Issue Body - Specify the body contents of the issue to create.
|
|
- `assignees` (string, optional): Assignees - Specify the assignee(s)' GitHub login as an array of strings for this issue. (example: `["octocat"]`).
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/update_issue">
|
|
**Description:** Update an issue in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
|
- `issue_number` (string, required): Issue Number - Specify the number of the issue to update.
|
|
- `title` (string, required): Issue Title - Specify the title of the issue to update.
|
|
- `body` (string, optional): Issue Body - Specify the body contents of the issue to update.
|
|
- `assignees` (string, optional): Assignees - Specify the assignee(s)' GitHub login as an array of strings for this issue. (example: `["octocat"]`).
|
|
- `state` (string, optional): State - Specify the updated state of the issue.
|
|
- Options: `open`, `closed`
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/get_issue_by_number">
|
|
**Description:** Get an issue by number in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
|
- `issue_number` (string, required): Issue Number - Specify the number of the issue to fetch.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/lock_issue">
|
|
**Description:** Lock an issue in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
|
- `issue_number` (string, required): Issue Number - Specify the number of the issue to lock.
|
|
- `lock_reason` (string, required): Lock Reason - Specify a reason for locking the issue or pull request conversation.
|
|
- Options: `off-topic`, `too heated`, `resolved`, `spam`
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/search_issue">
|
|
**Description:** Search for issues in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
|
- `filter` (object, required): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
|
```json
|
|
{
|
|
"operator": "OR",
|
|
"conditions": [
|
|
{
|
|
"operator": "AND",
|
|
"conditions": [
|
|
{
|
|
"field": "assignee",
|
|
"operator": "$stringExactlyMatches",
|
|
"value": "octocat"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
```
|
|
Available fields: `assignee`, `creator`, `mentioned`, `labels`
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/create_release">
|
|
**Description:** Create a release in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
|
- `tag_name` (string, required): Name - Specify the name of the release tag to be created. (example: "v1.0.0").
|
|
- `target_commitish` (string, optional): Target - Specify the target of the release. This can either be a branch name or a commit SHA. Defaults to the main branch. (example: "master").
|
|
- `body` (string, optional): Body - Specify a description for this release.
|
|
- `draft` (string, optional): Draft - Specify whether the created release should be a draft (unpublished) release.
|
|
- Options: `true`, `false`
|
|
- `prerelease` (string, optional): Prerelease - Specify whether the created release should be a prerelease.
|
|
- Options: `true`, `false`
|
|
- `discussion_category_name` (string, optional): Discussion Category Name - If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository.
|
|
- `generate_release_notes` (string, optional): Release Notes - Specify whether the created release should automatically create release notes using the provided name and body specified.
|
|
- Options: `true`, `false`
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/update_release">
|
|
**Description:** Update a release in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
|
- `id` (string, required): Release ID - Specify the ID of the release to update.
|
|
- `tag_name` (string, optional): Name - Specify the name of the release tag to be updated. (example: "v1.0.0").
|
|
- `target_commitish` (string, optional): Target - Specify the target of the release. This can either be a branch name or a commit SHA. Defaults to the main branch. (example: "master").
|
|
- `body` (string, optional): Body - Specify a description for this release.
|
|
- `draft` (string, optional): Draft - Specify whether the created release should be a draft (unpublished) release.
|
|
- Options: `true`, `false`
|
|
- `prerelease` (string, optional): Prerelease - Specify whether the created release should be a prerelease.
|
|
- Options: `true`, `false`
|
|
- `discussion_category_name` (string, optional): Discussion Category Name - If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository.
|
|
- `generate_release_notes` (string, optional): Release Notes - Specify whether the created release should automatically create release notes using the provided name and body specified.
|
|
- Options: `true`, `false`
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/get_release_by_id">
|
|
**Description:** Get a release by ID in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
|
- `id` (string, required): Release ID - Specify the release ID of the release to fetch.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/get_release_by_tag_name">
|
|
**Description:** Get a release by tag name in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
|
- `tag_name` (string, required): Name - Specify the tag of the release to fetch. (example: "v1.0.0").
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="github/delete_release">
|
|
**Description:** Delete a release in GitHub.
|
|
|
|
**Parameters:**
|
|
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
|
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
|
- `id` (string, required): Release ID - Specify the ID of the release to delete.
|
|
|
|
</Accordion>
|
|
</AccordionGroup>
|
|
|
|
## Usage Examples
|
|
|
|
### Basic GitHub Agent Setup
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
from crewai import Agent, Task, Crew
|
|
|
|
# Create an agent with Github capabilities
|
|
github_agent = Agent(
|
|
role="Repository Manager",
|
|
goal="Manage GitHub repositories, issues, and releases efficiently",
|
|
backstory="An AI assistant specialized in repository management and issue tracking.",
|
|
apps=['github'] # All Github actions will be available
|
|
)
|
|
|
|
# Task to create a new issue
|
|
create_issue_task = Task(
|
|
description="Create a bug report issue for the login functionality in the main repository",
|
|
agent=github_agent,
|
|
expected_output="Issue created successfully with issue number"
|
|
)
|
|
|
|
# Run the task
|
|
crew = Crew(
|
|
agents=[github_agent],
|
|
tasks=[create_issue_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
### Filtering Specific GitHub Tools
|
|
|
|
```python
|
|
|
|
issue_manager = Agent(
|
|
role="Issue Manager",
|
|
goal="Create and manage GitHub issues efficiently",
|
|
backstory="An AI assistant that focuses on issue tracking and management.",
|
|
apps=['github/create_issue']
|
|
)
|
|
|
|
# Task to manage issue workflow
|
|
issue_workflow = Task(
|
|
description="Create a feature request issue and assign it to the development team",
|
|
agent=issue_manager,
|
|
expected_output="Feature request issue created and assigned successfully"
|
|
)
|
|
|
|
crew = Crew(
|
|
agents=[issue_manager],
|
|
tasks=[issue_workflow]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
### Release Management
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
|
|
release_manager = Agent(
|
|
role="Release Manager",
|
|
goal="Manage software releases and versioning",
|
|
backstory="An experienced release manager who handles version control and release processes.",
|
|
apps=['github']
|
|
)
|
|
|
|
# Task to create a new release
|
|
release_task = Task(
|
|
description="""
|
|
Create a new release v2.1.0 for the project with:
|
|
- Auto-generated release notes
|
|
- Target the main branch
|
|
- Include a description of new features and bug fixes
|
|
""",
|
|
agent=release_manager,
|
|
expected_output="Release v2.1.0 created successfully with release notes"
|
|
)
|
|
|
|
crew = Crew(
|
|
agents=[release_manager],
|
|
tasks=[release_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
### Issue Tracking and Management
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
|
|
project_coordinator = Agent(
|
|
role="Project Coordinator",
|
|
goal="Track and coordinate project issues and development progress",
|
|
backstory="An AI assistant that helps coordinate development work and track project progress.",
|
|
apps=['github']
|
|
)
|
|
|
|
# Complex task involving multiple GitHub operations
|
|
coordination_task = Task(
|
|
description="""
|
|
1. Search for all open issues assigned to the current milestone
|
|
2. Identify overdue issues and update their priority labels
|
|
3. Create a weekly progress report issue
|
|
4. Lock resolved issues that have been inactive for 30 days
|
|
""",
|
|
agent=project_coordinator,
|
|
expected_output="Project coordination completed with progress report and issue management"
|
|
)
|
|
|
|
crew = Crew(
|
|
agents=[project_coordinator],
|
|
tasks=[coordination_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
### Getting Help
|
|
|
|
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
|
Contact our support team for assistance with GitHub integration setup or
|
|
troubleshooting.
|
|
</Card>
|