gitflow-github
GitHub platform implementation for gf — Issue, PR, Release, and Review providers via gh CLI.
Overview
gitflow-github provides GitHub-specific implementations of the core platform traits defined in gitflow-core. It uses the official gh CLI under the hood for all GitHub API interactions.
Features
- Issue Provider: Create, list, view, and manage GitHub Issues
- PR Provider: Create, review, and manage Pull Requests
- Release Provider: Create and manage GitHub Releases
- Review Provider: Submit and manage code reviews
- Pipeline Provider: Monitor GitHub Actions workflows
- Authentication: Leverages
gh authfor authentication - Async Support: Full async/await support with Tokio
Installation
Add to your Cargo.toml:
[]
= "0.8"
Prerequisites
This crate requires the GitHub CLI (gh) to be installed and authenticated:
# Install gh CLI
# See: https://cli.github.com/ for other platforms
# Authenticate
Usage
Creating a GitHub Provider
use GitHubProvider;
use IssueProvider;
async
Working with Issues
use GitHubProvider;
use ;
let provider = new?;
// Create an issue
let issue = provider.create_issue.await?;
// Update issue state
provider.update_issue_state.await?;
Working with Pull Requests
use GitHubProvider;
use PrProvider;
let provider = new?;
// Create a PR
let pr = provider.create_pr.await?;
// Merge PR
provider.merge_pr.await?;
Working with Releases
use GitHubProvider;
use ReleaseProvider;
let provider = new?;
// Create a release
let release = provider.create_release.await?;
// List releases
let releases = provider.list_releases.await?;
Code Reviews
use GitHubProvider;
use ;
let provider = new?;
// Submit a review
provider.submit_review.await?;
Architecture
┌─────────────────────────────────────┐
│ gitflow-core (traits) │
│ IssueProvider, PrProvider, etc. │
└──────────────────┬──────────────────┘
│ implements
▼
┌─────────────────────────────────────┐
│ gitflow-github (this crate) │
│ GitHubProvider │
└──────────────────┬──────────────────┘
│ uses
▼
┌─────────────────────────────────────┐
│ gh CLI (GitHub API) │
└─────────────────────────────────────┘
Error Handling
All operations return Result<T, gf_core::Error>:
use GitHubProvider;
use Error;
let provider = new?;
match provider.list_issues.await
Environment Variables
GH_TOKEN/GITHUB_TOKEN— GitHub authentication token (optional ifgh auth loginwas used)GH_HOST— GitHub Enterprise hostname (optional)
Ecosystem
This crate is part of the gf workspace:
- gitflow-core — Core types and traits
- gitflow-github (this crate) — GitHub platform implementation
- gitflow-gitlab — GitLab platform implementation
- gitflow-gitcode — GitCode platform implementation
- gf — CLI application
Documentation
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines.
License
Licensed under the MIT License. See LICENSE for details.