Skip to content
Proud to collaborate with Microsoft for Startups

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 ​

PropertyValue
Workflow typeAtomic
LibraryApp-github
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
ownerstringYes—Repository owner
repostringYes—Repository name
refstringYes—Branch, tag, or commit/tree SHA
pathstringNo—Path prefix to filter to (repo root if omitted)
include_treesbooleanNo—Include directory entries (default False)
organization_uuiduuidNo—Optional organization context

Output Schema ​

FieldTypeRequiredDefaultDescription
ownerstringNo——
repostringNo——
refstringNo——
pathstringNo——
include_treesbooleanNo——
organization_uuiduuidNo——
entriesjsonNo——
truncatedbooleanNo——
tree_shastringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
errorstringNo——
error_typestringNo——
failed_layerjsonNo——
failed_stepjsonNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

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"
  }
}