Automate GitHub repositories, issues, pull requests, branches, CI/CD, and permissions via Rube MCP (Composio). Manage code workflows, review PRs, search code, and handle deployments programmatically.
Add this skill
npx mdskills install sickn33/github-automationComprehensive GitHub automation with detailed workflows, pitfalls, and safety guards for all major operations
1---2name: github-automation3description: "Automate GitHub repositories, issues, pull requests, branches, CI/CD, and permissions via Rube MCP (Composio). Manage code workflows, review PRs, search code, and handle deployments programmatically."4requires:5 mcp: [rube]6---78# GitHub Automation via Rube MCP910Automate GitHub repository management, issue tracking, pull request workflows, branch operations, and CI/CD through Composio's GitHub toolkit.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active GitHub connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `github`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `github`253. If connection is not ACTIVE, follow the returned auth link to complete GitHub OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. Create and Manage Issues3132**When to use**: User wants to create, list, or manage GitHub issues3334**Tool sequence**:351. `GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER` - Find target repo if unknown [Prerequisite]362. `GITHUB_LIST_REPOSITORY_ISSUES` - List existing issues (includes PRs) [Required]373. `GITHUB_CREATE_AN_ISSUE` - Create a new issue [Required]384. `GITHUB_CREATE_AN_ISSUE_COMMENT` - Add comments to an issue [Optional]395. `GITHUB_SEARCH_ISSUES_AND_PULL_REQUESTS` - Search across repos by keyword [Optional]4041**Key parameters**:42- `owner`: Repository owner (username or org), case-insensitive43- `repo`: Repository name without .git extension44- `title`: Issue title (required for creation)45- `body`: Issue description (supports Markdown)46- `labels`: Array of label names47- `assignees`: Array of GitHub usernames48- `state`: 'open', 'closed', or 'all' for filtering4950**Pitfalls**:51- `GITHUB_LIST_REPOSITORY_ISSUES` returns both issues AND pull requests; check `pull_request` field to distinguish52- Only users with push access can set assignees, labels, and milestones; they are silently dropped otherwise53- Pagination: `per_page` max 100; iterate pages until empty5455### 2. Manage Pull Requests5657**When to use**: User wants to create, review, or merge pull requests5859**Tool sequence**:601. `GITHUB_FIND_PULL_REQUESTS` - Search and filter PRs [Required]612. `GITHUB_GET_A_PULL_REQUEST` - Get detailed PR info including mergeable status [Required]623. `GITHUB_LIST_PULL_REQUESTS_FILES` - Review changed files [Optional]634. `GITHUB_CREATE_A_PULL_REQUEST` - Create a new PR [Required]645. `GITHUB_CREATE_AN_ISSUE_COMMENT` - Post review comments [Optional]656. `GITHUB_LIST_CHECK_RUNS_FOR_A_REF` - Verify CI status before merge [Optional]667. `GITHUB_MERGE_A_PULL_REQUEST` - Merge after explicit user approval [Required]6768**Key parameters**:69- `head`: Source branch with changes (must exist; for cross-repo: 'username:branch')70- `base`: Target branch to merge into (e.g., 'main')71- `title`: PR title (required unless `issue` number provided)72- `merge_method`: 'merge', 'squash', or 'rebase'73- `state`: 'open', 'closed', or 'all'7475**Pitfalls**:76- `GITHUB_CREATE_A_PULL_REQUEST` fails with 422 if base/head are invalid, identical, or already merged77- `GITHUB_MERGE_A_PULL_REQUEST` can be rejected if PR is draft, closed, or branch protection applies78- Always verify mergeable status with `GITHUB_GET_A_PULL_REQUEST` immediately before merging79- Require explicit user confirmation before calling MERGE8081### 3. Manage Repositories and Branches8283**When to use**: User wants to create repos, manage branches, or update repo settings8485**Tool sequence**:861. `GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER` - List user's repos [Required]872. `GITHUB_GET_A_REPOSITORY` - Get detailed repo info [Optional]883. `GITHUB_CREATE_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER` - Create personal repo [Required]894. `GITHUB_CREATE_AN_ORGANIZATION_REPOSITORY` - Create org repo [Alternative]905. `GITHUB_LIST_BRANCHES` - List branches [Required]916. `GITHUB_CREATE_A_REFERENCE` - Create new branch from SHA [Required]927. `GITHUB_UPDATE_A_REPOSITORY` - Update repo settings [Optional]9394**Key parameters**:95- `name`: Repository name96- `private`: Boolean for visibility97- `ref`: Full reference path (e.g., 'refs/heads/new-branch')98- `sha`: Commit SHA to point the new reference to99- `default_branch`: Default branch name100101**Pitfalls**:102- `GITHUB_CREATE_A_REFERENCE` only creates NEW references; use `GITHUB_UPDATE_A_REFERENCE` for existing ones103- `ref` must start with 'refs/' and contain at least two slashes104- `GITHUB_LIST_BRANCHES` paginates via `page`/`per_page`; iterate until empty page105- `GITHUB_DELETE_A_REPOSITORY` is permanent and irreversible; requires admin privileges106107### 4. Search Code and Commits108109**When to use**: User wants to find code, files, or commits across repositories110111**Tool sequence**:1121. `GITHUB_SEARCH_CODE` - Search file contents and paths [Required]1132. `GITHUB_SEARCH_CODE_ALL_PAGES` - Multi-page code search [Alternative]1143. `GITHUB_SEARCH_COMMITS_BY_AUTHOR` - Search commits by author/date/org [Required]1154. `GITHUB_LIST_COMMITS` - List commits for a specific repo [Alternative]1165. `GITHUB_GET_A_COMMIT` - Get detailed commit info [Optional]1176. `GITHUB_GET_REPOSITORY_CONTENT` - Get file content [Optional]118119**Key parameters**:120- `q`: Search query with qualifiers (`language:python`, `repo:owner/repo`, `extension:js`)121- `owner`/`repo`: For repo-specific commit listing122- `author`: Filter by commit author123- `since`/`until`: ISO 8601 date range for commits124125**Pitfalls**:126- Code search only indexes files under 384KB on default branch127- Maximum 1000 results returned from code search128- `GITHUB_SEARCH_COMMITS_BY_AUTHOR` requires keywords in addition to qualifiers; qualifier-only queries are not allowed129- `GITHUB_LIST_COMMITS` returns 409 on empty repos130131### 5. Manage CI/CD and Deployments132133**When to use**: User wants to view workflows, check CI status, or manage deployments134135**Tool sequence**:1361. `GITHUB_LIST_REPOSITORY_WORKFLOWS` - List GitHub Actions workflows [Required]1372. `GITHUB_GET_A_WORKFLOW` - Get workflow details by ID or filename [Optional]1383. `GITHUB_CREATE_A_WORKFLOW_DISPATCH_EVENT` - Manually trigger a workflow [Required]1394. `GITHUB_LIST_CHECK_RUNS_FOR_A_REF` - Check CI status for a commit/branch [Required]1405. `GITHUB_LIST_DEPLOYMENTS` - List deployments [Optional]1416. `GITHUB_GET_A_DEPLOYMENT_STATUS` - Get deployment status [Optional]142143**Key parameters**:144- `workflow_id`: Numeric ID or filename (e.g., 'ci.yml')145- `ref`: Git reference (branch/tag) for workflow dispatch146- `inputs`: JSON string of workflow inputs matching `on.workflow_dispatch.inputs`147- `environment`: Filter deployments by environment name148149**Pitfalls**:150- `GITHUB_CREATE_A_WORKFLOW_DISPATCH_EVENT` requires the workflow to have `workflow_dispatch` trigger configured151- Full path `.github/workflows/main.yml` is auto-stripped to just `main.yml`152- Inputs max 10 key-value pairs; must match workflow's `on.workflow_dispatch.inputs` definitions153154### 6. Manage Users and Permissions155156**When to use**: User wants to check collaborators, permissions, or branch protection157158**Tool sequence**:1591. `GITHUB_LIST_REPOSITORY_COLLABORATORS` - List repo collaborators [Required]1602. `GITHUB_GET_REPOSITORY_PERMISSIONS_FOR_A_USER` - Check specific user's access [Optional]1613. `GITHUB_GET_BRANCH_PROTECTION` - Inspect branch protection rules [Required]1624. `GITHUB_UPDATE_BRANCH_PROTECTION` - Update protection settings [Optional]1635. `GITHUB_ADD_A_REPOSITORY_COLLABORATOR` - Add/update collaborator [Optional]164165**Key parameters**:166- `affiliation`: 'outside', 'direct', or 'all' for collaborator filtering167- `permission`: Filter by 'pull', 'triage', 'push', 'maintain', 'admin'168- `branch`: Branch name for protection rules169- `enforce_admins`: Whether protection applies to admins170171**Pitfalls**:172- `GITHUB_GET_BRANCH_PROTECTION` returns 404 for unprotected branches; treat as no protection rules173- Determine push ability from `permissions.push` or `role_name`, not display labels174- `GITHUB_LIST_REPOSITORY_COLLABORATORS` paginates; iterate all pages175- `GITHUB_GET_REPOSITORY_PERMISSIONS_FOR_A_USER` may be inconclusive for non-collaborators176177## Common Patterns178179### ID Resolution180- **Repo name -> owner/repo**: `GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER`181- **PR number -> PR details**: `GITHUB_FIND_PULL_REQUESTS` then `GITHUB_GET_A_PULL_REQUEST`182- **Branch name -> SHA**: `GITHUB_GET_A_BRANCH`183- **Workflow name -> ID**: `GITHUB_LIST_REPOSITORY_WORKFLOWS`184185### Pagination186All list endpoints use page-based pagination:187- `page`: Page number (starts at 1)188- `per_page`: Results per page (max 100)189- Iterate until response returns fewer results than `per_page`190191### Safety192- Always verify PR mergeable status before merge193- Require explicit user confirmation for destructive operations (merge, delete)194- Check CI status with `GITHUB_LIST_CHECK_RUNS_FOR_A_REF` before merging195196## Known Pitfalls197198- **Issues vs PRs**: `GITHUB_LIST_REPOSITORY_ISSUES` returns both; check `pull_request` field199- **Pagination limits**: `per_page` max 100; always iterate pages until empty200- **Branch creation**: `GITHUB_CREATE_A_REFERENCE` fails with 422 if reference already exists201- **Merge guards**: Merge can fail due to branch protection, failing checks, or draft status202- **Code search limits**: Only files <384KB on default branch; max 1000 results203- **Commit search**: Requires search text keywords alongside qualifiers204- **Destructive actions**: Repo deletion is irreversible; merge cannot be undone205- **Silent permission drops**: Labels, assignees, milestones silently dropped without push access206207## Quick Reference208209| Task | Tool Slug | Key Params |210|------|-----------|------------|211| List repos | `GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER` | `type`, `sort`, `per_page` |212| Get repo | `GITHUB_GET_A_REPOSITORY` | `owner`, `repo` |213| Create issue | `GITHUB_CREATE_AN_ISSUE` | `owner`, `repo`, `title`, `body` |214| List issues | `GITHUB_LIST_REPOSITORY_ISSUES` | `owner`, `repo`, `state` |215| Find PRs | `GITHUB_FIND_PULL_REQUESTS` | `repo`, `state`, `author` |216| Create PR | `GITHUB_CREATE_A_PULL_REQUEST` | `owner`, `repo`, `head`, `base`, `title` |217| Merge PR | `GITHUB_MERGE_A_PULL_REQUEST` | `owner`, `repo`, `pull_number`, `merge_method` |218| List branches | `GITHUB_LIST_BRANCHES` | `owner`, `repo` |219| Create branch | `GITHUB_CREATE_A_REFERENCE` | `owner`, `repo`, `ref`, `sha` |220| Search code | `GITHUB_SEARCH_CODE` | `q` |221| List commits | `GITHUB_LIST_COMMITS` | `owner`, `repo`, `author`, `since` |222| Search commits | `GITHUB_SEARCH_COMMITS_BY_AUTHOR` | `q` |223| List workflows | `GITHUB_LIST_REPOSITORY_WORKFLOWS` | `owner`, `repo` |224| Trigger workflow | `GITHUB_CREATE_A_WORKFLOW_DISPATCH_EVENT` | `owner`, `repo`, `workflow_id`, `ref` |225| Check CI | `GITHUB_LIST_CHECK_RUNS_FOR_A_REF` | `owner`, `repo`, ref |226| List collaborators | `GITHUB_LIST_REPOSITORY_COLLABORATORS` | `owner`, `repo` |227| Branch protection | `GITHUB_GET_BRANCH_PROTECTION` | `owner`, `repo`, `branch` |228
Full transparency — inspect the skill content before installing.