Skip to main content

github.github.gettree

Home > @runlightyear/github > GitHub > getTree

GitHub.getTree() method

Get a tree

Signature:
getTree(props: GetTreeProps): Promise<GetTreeResponse>;

Parameters

ParameterTypeDescription
propsGetTreeProps
Returns:

Promise<GetTreeResponse>

Example

Get a tree

import { defineAction } from "@runlightyear/lightyear";
import { GitHub } from "@runlightyear/github";

defineAction({
name: "getTree",
title: "Get Tree",
apps: ["github"],
variables: ["owner", "repo", "treeSha"],
run: async ({ auths, variables }) => {
const github = new GitHub({
auth: auths.github,
});

const response = await github.getTree({
owner: variables.owner!,
repo: variables.repo!,
treeSha: variables.treeSha!,
recursive: true,
});

console.log("Response: ", response.data);
},
});