Use this skill whenever a non-technical person (often over WhatsApp) needs lightweight GitHub help without cloning or forking a repo. Typical asks:
The workflow relies entirely on the GitHub REST API using a personal access token (PAT) the requester provides during the chat.
owner/name.repo scope (private repos) or public_repo (public). Remind them to generate a short-lived token and send it in the chat; you’ll discard it afterward._Always restate the inputs back to them before acting. If anything is missing, pause and ask._
```bash
export GITHUB_TOKEN="
```
unset GITHUB_TOKEN.Authorization: Bearer $GITHUB_TOKEN and Accept: application/vnd.github+json.GET /repos/{owner}/{repo} – confirms access and surfaces default branch.GET /repos/{owner}/{repo}/commits?since=&until= author= or group results locally.GET /repos/{owner}/{repo}/issues?state=all&since=.pull_request key.Record the raw JSON responses (e.g., save to /tmp/commits.json) if you need to run jq filters before summarizing.
When you need file-level context (to quote code in an issue or explain why a commit matters), walk the tree via the REST API:
GET /repos/{owner}/{repo}/contents/?ref= returns metadata plus download URLs.download_url or call GET /repos/{owner}/{repo}/contents/ with header Accept: application/vnd.github.raw.GET /repos/{owner}/{repo}/git/trees/?recursive=1 to grab the whole structure, then request the files you care about./tmp/github-chat-ops//... ) so subsequent lookups avoid extra API calls.Always mention the file + path + relevant snippet when writing summaries or issues.
Translate activity into plain language:
GET /repos/{owner}/{repo}/commits/{sha} to see files[] (filenames, additions/removals, patch).quiz_generator.py to support context prompts and added 3 YAML fixtures."Keep summaries short, bullet-style, and avoid jargon.
POST /repos/{owner}/{repo}/issues with JSON payload:```json
{
"title": "...",
"body": "...",
"assignees": ["username"],
"labels": ["priority:high"]
}
```
_For follow-ups_, use PATCH /repos/{owner}/{repo}/issues/{number} to update state or assignees, and POST /repos/{owner}/{repo}/issues/{number}/comments for status notes.
.env.github-chat-ops with GITHUB_CHAT_OPS_TOKEN, repo, timezone).scripts/ (see scripts/github_chat_ops_daily.py) that load env vars, call the same APIs, and print a ready-to-send summary.cron, run the script from the workspace root, capture stdout verbatim for the message, and surface errors if the script exits non-zero.Use references/github-api-cheatsheet.md for ready-made curl templates covering the endpoints above plus pagination tips.
共 1 个版本