GitHub
Read and create GitHub data through the GitHub REST API.
A single InTouch tool that branches on an operation input so the AI assistant
(or any YAML job) can list/read issues, list pull requests and releases, look up
a repository, and open new issues.
- Base URL:
https://api.github.com - Auth:
Authorization: Bearer <token>(personal access token) - Headers sent:
Accept: application/vnd.github+json,X-GitHub-Api-Version: 2022-11-28 - Library: Python standard library only (
urllib), no external deps. - Response bodies are capped at 5 MB. Non-2xx responses are returned (with their
status) instead of raising, so you can inspect GitHub's error JSON.
Operations
| operation | Method & endpoint | Required inputs | Notes |
|---|---|---|---|
list-issues |
GET /repos/{owner}/{repo}/issues?state=<state> |
owner, repo |
state = open / closed / all (default open) |
get-issue |
GET /repos/{owner}/{repo}/issues/{issueNumber} |
owner, repo, issueNumber |
|
create-issue |
POST /repos/{owner}/{repo}/issues |
owner, repo, title |
optional body, labels (comma-separated) |
list-prs |
GET /repos/{owner}/{repo}/pulls?state=<state> |
owner, repo |
state filter same as issues |
list-releases |
GET /repos/{owner}/{repo}/releases |
owner, repo |
|
get-repo |
GET /repos/{owner}/{repo} |
owner, repo |
repository metadata |
Inputs
| name | required | description |
|---|---|---|
apiKey |
yes | GitHub personal access token. Sent as Authorization: Bearer. |
operation |
yes | One of the operations above. |
owner |
yes | Repository owner (user or org login). |
repo |
yes | Repository name. |
issueNumber |
for get-issue |
The issue number. |
title |
for create-issue |
Issue title. |
body |
no | Issue body (create-issue). |
labels |
no | Comma-separated label names (create-issue). |
state |
no | open / closed / all for list-issues and list-prs. Default open. |
Outputs
| key | description |
|---|---|
result |
The raw response body (JSON text from GitHub). |
status |
HTTP status code as a string (e.g. 200, 201, 404). |
ok |
"true" when the status is 2xx, else "false". |
operation |
Echo of the operation that ran. |
Getting the apiKey (token)
- Go to https://github.com/settings/tokens.
- Create a personal access token — classic or fine-grained.
- Scopes: the
reposcope is needed for private repositories and to create issues. Read-only access to public repos works with a minimal/no scope token, but a token is still required (unauthenticated calls are heavily rate-limited). - Copy the token and pass it as
apiKey(in InTouch, store it as a runtime environment variable or credential and reference it — never hard-code it).
Examples
List open issues
operation = list-issues
apiKey = ghp_xxxxxxxxxxxxxxxxxxxx
owner = octocat
repo = hello-world
state = open
Returns status = 200 and result = a JSON array of issue objects.
Create an issue with labels
operation = create-issue
apiKey = ghp_xxxxxxxxxxxxxxxxxxxx
owner = octocat
repo = hello-world
title = Build fails on JDK 17
body = Steps to reproduce: run ./gradlew build ...
labels = bug, build
Returns status = 201 and result = the created issue object (including its
number and html_url).