Skip to content

GitHub Read

Overview

The GitHub Read node fetches file contents or directory listings from a GitHub repository using the GitHub REST API. It requires a configured GitHub credential (personal access token or OAuth) and supports both public and private repositories. On success it emits the decoded file content and metadata; on failure it routes to the error port with a structured error object containing the HTTP status and message.

Configuration

FieldTypeRequiredDescription
credential_idstringYesID of the stored GitHub credential (PAT or OAuth token) used to authenticate API requests.
ownerstringYesGitHub repository owner — either a username or organization name (e.g. 'acme-corp').
repostringYesRepository name, without the owner prefix (e.g. 'my-repo').
pathstringYesPath to the file or directory within the repository (e.g. 'src/index.ts'). Use an empty string or '/' for the root.
refstringNoBranch name, tag, or full commit SHA to read from. Defaults to the repository's default branch if omitted.
encodingenumNoOutput encoding for file content. Options: 'utf8' (default) or 'base64'. Use 'base64' for binary files.

Inputs

PortTypeDescription
inputobjectTrigger signal. May carry dynamic overrides for 'owner', 'repo', 'path', or 'ref' that take precedence over static config values.

Outputs

PortTypeDescription
outputobjectEmitted on success. Contains 'content' (decoded file string or array of directory entries), 'sha' (blob SHA), 'size' (bytes), 'encoding', and 'html_url'.
errorobjectEmitted when the request fails (e.g. 404 not found, 401 unauthorized, rate limit exceeded). Contains 'status' (HTTP code), 'message', and 'path' that was requested.

Example

json
{
  "nodeType": "github_read",
  "config": {
    "credential_id": "cred_gh_prod_pat",
    "owner": "acme-corp",
    "repo": "model-prompts",
    "path": "prompts/judge-v2.md",
    "ref": "main"
  }
}