github.code.get_tree ​
List a repository's file tree at a ref (recursive, path-filtered)
List the file tree of a GitHub repository at a given ref (recursive).
Wraps the Git Trees API (GET /repos/{owner}/{repo}/git/trees/{ref}?recursive=1). ref may be a branch name, tag name, or commit/tree SHA — GitHub resolves it to that revision's tree. Optionally narrows the result to entries under a path prefix (e.g. "k8s/prod"), which is how GitOps reads just the manifests directory of a repo.
Returns blob entries (files) with the blob SHA needed to fetch raw content via github.code.get_blob. Directory ("tree") entries are filtered out by default.
Inputs:
- owner: Repository owner (required).
- repo: Repository name (required).
- ref: Branch, tag, or commit/tree SHA (required).
- path: Path prefix to filter to, e.g. "k8s/prod" (optional; repo root = "").
- include_trees: Include directory entries too (optional, default False).
Outputs (terminal state_data):
- entries: list of {path, sha, mode, type, size} — blobs (and trees if asked).
- truncated: bool — True if GitHub truncated the listing (very large repos).
- tree_sha: str — the resolved tree SHA the listing came from.
Plugin required: github auth via installation_bearer (see _auth.py).
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-github |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
owner | string | Yes | — | Repository owner |
repo | string | Yes | — | Repository name |
ref | string | Yes | — | Branch, tag, or commit/tree SHA |
path | string | No | — | Path prefix to filter to (repo root if omitted) |
include_trees | boolean | No | — | Include directory entries (default False) |
organization_uuid | uuid | No | — | Optional organization context |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
owner | string | No | — | — |
repo | string | No | — | — |
ref | string | No | — | — |
path | string | No | — | — |
include_trees | boolean | No | — | — |
organization_uuid | uuid | No | — | — |
entries | json | No | — | — |
truncated | boolean | No | — | — |
tree_sha | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_layer | json | No | — | — |
failed_step | json | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "github.code.get_tree",
"initial_data": {
"owner": "value",
"repo": "value",
"ref": "value"
}
}