| name | github-access |
| description | Access GitHub repositories programmatically using the exe.dev GitHub integration, gh CLI, or REST API. Use when interacting with GitHub repositories, issues, pull requests, workflows, discussions, or actions. On exe.dev VMs, prefer the tokenless GitHub integration before falling back to local gh authentication or GH_TOKEN. |
GitHub Access
Overview
This skill enables programmatic GitHub access through the exe.dev GitHub integration, the gh CLI, or the REST API with curl. Prefer credentials held outside the VM when exe.dev provides them.
Prerequisites and Tool Selection
Before performing GitHub operations, follow this workflow:
1. Prefer the exe.dev GitHub integration
On an exe.dev VM with gh installed, test the aggregate integration hostname:
GH_HOST=github.int.exe.xyz gh auth status --hostname github.int.exe.xyz
If this succeeds, use the integration for the rest of the task:
export GH_HOST=github.int.exe.xyz
gh repo view OWNER/REPO
gh issue list --repo OWNER/REPO
No GH_TOKEN is needed. The credential stays outside the VM and is injected at the network edge. Read references/exe-dev-integration.md for setup, repository scope, read-only mode, attribution, cloning, and pushing.
For Git operations, use the integration hostname rather than github.com:
git clone https://github.int.exe.xyz/OWNER/REPO.git
git push https://github.int.exe.xyz/OWNER/REPO.git HEAD
2. Fall back to ordinary GitHub authentication
Only when the exe.dev integration is unavailable:
-
If gh is installed and gh auth status --hostname github.com succeeds, use gh with its existing authentication.
-
Otherwise, check whether GH_TOKEN is non-empty without printing it:
test -n "${GH_TOKEN:-}"
-
If no authentication is available, stop and ask the user to configure the exe.dev GitHub integration, run gh auth login, or provide GH_TOKEN. Never print or log token values.
3. Load the appropriate reference
- exe.dev integration available: Read
references/exe-dev-integration.md, then use references/gh-commands.md.
- Ordinary
gh authentication available: Read references/gh-commands.md.
- Only
curl and GH_TOKEN available: Read references/curl-api.md.
references/mcp-tools.md lists GitHub MCP tools and parameters.
Key Operations
These are the most commonly used GitHub operations. Detailed commands for both gh and curl are provided in the reference documents.
1. Read Issue Content
Use case: Get the full details of a GitHub issue including title, body, state, labels, and metadata.
When to use: When the user provides an issue number or URL, or when following up on search results.
With gh:
gh issue view ISSUE_NUMBER --repo OWNER/REPO
gh issue view ISSUE_NUMBER --json title,body,state,labels --repo OWNER/REPO
With curl:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER
2. Read Pull Request Comments
Use case: Retrieve comments and reviews on a pull request. GitHub has several types of PR comments:
- Regular comments: General discussion comments on the PR (use
/issues/ endpoint)
- Review summaries: Top-level review with overall feedback (use
/reviews endpoint)
- Inline review comments: Code-specific comments on file changes (use
/pulls/.../comments endpoint)
When to use: When reviewing feedback on a PR, understanding discussion context, or analyzing review comments.
With gh:
gh pr view PR_NUMBER --comments --repo OWNER/REPO
gh pr view PR_NUMBER --json comments,reviews --repo OWNER/REPO
With curl:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/pulls/PR_NUMBER/reviews
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/pulls/PR_NUMBER/comments
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/issues/PR_NUMBER/comments
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/pulls/PR_NUMBER/reviews/REVIEW_ID/comments
3. Check Workflow Status and Fetch Failure Logs
Use case: Diagnose CI/CD failures by checking workflow run status and retrieving logs from failed jobs.
When to use: When a PR has failing checks, when investigating build failures, or when debugging CI/CD issues.
With gh:
gh pr checks PR_NUMBER --repo OWNER/REPO
RUN_ID=$(gh pr view PR_NUMBER --json headRefName --jq -r '.headRefName' | \
xargs -I {} gh run list --branch {} --limit 1 --json databaseId --jq '.[0].databaseId' --repo OWNER/REPO)
gh run view $RUN_ID --log-failed --repo OWNER/REPO
With curl:
PR_DATA=$(curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/pulls/PR_NUMBER)
HEAD_SHA=$(echo "$PR_DATA" | jq -r '.head.sha')
curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/commits/$HEAD_SHA/check-runs
RUNS=$(curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/OWNER/REPO/actions/runs?head_sha=$HEAD_SHA")
FAILED_RUN_ID=$(echo "$RUNS" | jq -r '.workflow_runs[] | select(.conclusion == "failure") | .id' | head -1)
curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/OWNER/REPO/actions/runs/$FAILED_RUN_ID/jobs?filter=failed"
JOB_ID=$(curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
| jq -r )
curl -L \
-H \
-H \
-H \
https://api.github.com/repos/OWNER/REPO/actions/jobs//logs
4. Search Issues
Use case: Find issues when the user doesn't provide a specific issue number or URL.
When to use: When the user mentions an issue by description, keyword, or topic rather than by number.
With gh:
gh issue list --search "QUERY" --repo OWNER/REPO
gh issue list --state open --label bug --repo OWNER/REPO
gh search issues "QUERY" --owner OWNER
With curl:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/issues?q=QUERY+repo:OWNER/REPO+type:issue"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/issues?q=is:open+label:bug+repo:OWNER/REPO+type:issue"
5. Search Pull Requests
Use case: Find pull requests when the user doesn't provide a specific PR number or URL.
When to use: When the user references a PR by description, author, branch name, or topic rather than by number.
With gh:
gh pr list --search "QUERY" --repo OWNER/REPO
gh pr list --state open --author USERNAME --repo OWNER/REPO
gh search prs "QUERY" --owner OWNER
With curl:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/issues?q=QUERY+repo:OWNER/REPO+type:pr"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/issues?q=is:open+author:USERNAME+repo:OWNER/REPO+type:pr"
Extracting Repository Information
When the user provides a GitHub URL, extract the owner and repository name:
Example URL formats:
https://github.com/owner/repo/issues/123
https://github.com/owner/repo/pull/456
https://github.com/owner/repo
Extraction with sed:
URL="https://github.com/owner/repo/issues/123"
OWNER_REPO=$(echo "$URL" | sed -E 's|https://github.com/([^/]+/[^/]+)/.*|\1|')
OWNER=$(echo "$OWNER_REPO" | cut -d'/' -f1)
REPO=$(echo "$OWNER_REPO" | cut -d'/' -f2)
Resources
This skill includes these reference documents:
references/mcp-tools.md
Complete list of all available GitHub MCP tools and their parameters. Use this as a reference for understanding available functionality and parameter requirements.
references/exe-dev-integration.md
Use exe.dev's GitHub integration without storing a GitHub token on the VM. Load this first on exe.dev VMs.
references/gh-commands.md
Comprehensive gh CLI commands for all GitHub operations. Load this document when gh is available. Includes:
- Actions and workflow operations
- Issue management
- Pull request operations
- Discussions (via GraphQL)
- Common patterns and tips
Official documentation: https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28&tool=cli
references/curl-api.md
Token-authenticated REST API calls using curl when neither the exe.dev integration nor authenticated gh is available. Includes:
- Complete REST API endpoints
- Request headers and authentication
- Response parsing with
jq
- GraphQL queries for discussions
- Pagination and rate limiting
Official documentation: https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28&tool=curl
Additional Operations
Beyond the key operations listed above, the reference documents provide detailed commands for:
- Workflows: Trigger, list, rerun, cancel, download artifacts
- Issues: Create, update, comment, label, assign, close
- Pull Requests: Create, update, merge, review, request reviewers, get diff
- Discussions: List, view, comment (via GraphQL)
- Labels: Get, create, update, delete
- Repository operations: Various repository-level operations
Consult the appropriate reference document (gh-commands.md or curl-api.md) for complete examples.