Skill v1.0.0
currentAutomated scan100/100version: "1.0.0" name: github-ops description: Provides comprehensive GitHub operations using gh CLI and GitHub API. Activates when working with pull requests, issues, repositories, workflows, or GitHub API operations including creating/viewing/merging PRs, managing issues, querying API endpoints, and handling GitHub workflows in enterprise or public GitHub environments.
GitHub Operations
Overview
This skill provides comprehensive guidance for GitHub operations using the gh CLI tool and GitHub REST/GraphQL APIs. Use this skill when performing any GitHub-related tasks including pull request management, issue tracking, repository operations, workflow automation, and API interactions.
When to Use This Skill
This skill activates for tasks involving:
- Creating, viewing, editing, or merging pull requests
- Managing GitHub issues or repository settings
- Querying GitHub API endpoints (REST or GraphQL)
- Working with GitHub Actions workflows
- Performing bulk operations on repositories
- Integrating with GitHub Enterprise
- Automating GitHub operations via CLI or API
Core Operations
Pull Requests
# Create PR with NOJIRA prefix (bypasses JIRA enforcement checks)gh pr create --title "NOJIRA: Your PR title" --body "PR description"# List and view PRsgh pr list --state opengh pr view 123# Manage PRsgh pr merge 123 --squashgh pr review 123 --approvegh pr comment 123 --body "LGTM"
📚 See references/pr_operations.md for comprehensive PR workflows
PR Title Convention:
- With JIRA ticket:
GR-1234: Descriptive title - Without JIRA ticket:
NOJIRA: Descriptive title
Issues
# Create and manage issuesgh issue create --title "Bug: Issue title" --body "Issue description"gh issue list --state open --label buggh issue edit 456 --add-label "priority-high"gh issue close 456
📚 See references/issue_operations.md for detailed issue management
Repositories
# View and manage reposgh repo view --webgh repo clone owner/repogh repo create my-new-repo --public
Workflows
# Manage GitHub Actionsgh workflow listgh workflow run workflow-namegh run watch run-idgh run download run-id
📚 See references/workflow_operations.md for advanced workflow operations
GitHub API
The gh api command provides direct access to GitHub REST API endpoints. Refer to references/api_reference.md for comprehensive API endpoint documentation.
Basic API operations:
# Get PR details via APIgh api repos/{owner}/{repo}/pulls/{pr_number}# Add PR commentgh api repos/{owner}/{repo}/issues/{pr_number}/comments \-f body="Comment text"# List workflow runsgh api repos/{owner}/{repo}/actions/runs
For complex queries requiring multiple related resources, use GraphQL. See references/api_reference.md for GraphQL examples.
Authentication and Configuration
# Login to GitHubgh auth login# Login to GitHub Enterprisegh auth login --hostname github.enterprise.com# Check authentication statusgh auth status# Set default repositorygh repo set-default owner/repo# Configure gh settingsgh config set editor vimgh config set git_protocol sshgh config list
Output Formats
Control output format for programmatic processing:
# JSON outputgh pr list --json number,title,state,author# JSON with jq processinggh pr list --json number,title | jq '.[] | select(.title | contains("bug"))'# Template outputgh pr list --template '{{range .}}{{.number}}: {{.title}}{{"\n"}}{{end}}'
📚 See references/best_practices.md for shell patterns and automation strategies
Quick Reference
Most Common Operations:
gh pr create --title "NOJIRA: Title" --body "Description" # Create PRgh pr list # List PRsgh pr view 123 # View PR detailsgh pr checks 123 # Check PR statusgh pr merge 123 --squash # Merge PRgh pr comment 123 --body "LGTM" # Comment on PRgh issue create --title "Title" --body "Description" # Create issuegh workflow run workflow-name # Run workflowgh repo view --web # Open repo in browsergh api repos/{owner}/{repo}/pulls/{pr_number} # Direct API call
Resources
references/pr_operations.md
Comprehensive pull request operations including:
- Detailed PR creation patterns (JIRA integration, body from file, targeting branches)
- Viewing and filtering strategies
- Review workflows and approval patterns
- PR lifecycle management
- Bulk operations and automation examples
Load this reference when working with complex PR workflows or bulk operations.
references/issue_operations.md
Detailed issue management examples including:
- Issue creation with labels and assignees
- Advanced filtering and search
- Issue lifecycle and state management
- Bulk operations on multiple issues
- Integration with PRs and projects
Load this reference when managing issues at scale or setting up issue workflows.
references/workflow_operations.md
Advanced GitHub Actions workflow operations including:
- Workflow triggers and manual runs
- Run monitoring and debugging
- Artifact management
- Secrets and variables
- Performance optimization strategies
Load this reference when working with CI/CD workflows or debugging failed runs.
references/best_practices.md
Shell scripting patterns and automation strategies including:
- Output formatting (JSON, templates, jq)
- Pagination and large result sets
- Error handling and retry logic
- Bulk operations and parallel execution
- Enterprise GitHub patterns
- Performance optimization
Load this reference when building automation scripts or handling enterprise deployments.
references/api_reference.md
Contains comprehensive GitHub REST API endpoint documentation including:
- Complete API endpoint reference with examples
- Request/response formats
- Authentication patterns
- Rate limiting guidance
- Webhook configurations
- Advanced GraphQL query patterns
Load this reference when performing complex API operations or when needing detailed endpoint specifications.