getTree

suspend fun getTree(argument: GetTreePlainArgs): GetTreeResult

Use this data source to retrieve information about a single tree.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetRepositoryArgs;
import com.pulumi.github.inputs.GetBranchArgs;
import com.pulumi.github.inputs.GetTreeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var thisRepository = GithubFunctions.getRepository(GetRepositoryArgs.builder()
.name("example")
.build());
final var thisBranch = GithubFunctions.getBranch(GetBranchArgs.builder()
.branch(thisRepository.applyValue(getRepositoryResult -> getRepositoryResult.defaultBranch()))
.repository(thisRepository.applyValue(getRepositoryResult -> getRepositoryResult.name()))
.build());
final var thisTree = GithubFunctions.getTree(GetTreeArgs.builder()
.recursive(false)
.repository(thisRepository.applyValue(getRepositoryResult -> getRepositoryResult.name()))
.treeSha(thisBranch.applyValue(getBranchResult -> getBranchResult.sha()))
.build());
ctx.export("entries", thisTree.applyValue(getTreeResult -> getTreeResult.entries()));
}
}

Return

A collection of values returned by getTree.

Parameters

argument

A collection of arguments for invoking getTree.


suspend fun getTree(recursive: Boolean? = null, repository: String, treeSha: String): GetTreeResult

Return

A collection of values returned by getTree.

Parameters

recursive

Setting this parameter to true returns the objects or subtrees referenced by the tree specified in tree_sha.

repository

The name of the repository.

treeSha

The SHA1 value for the tree.

See also


suspend fun getTree(argument: suspend GetTreePlainArgsBuilder.() -> Unit): GetTreeResult

Return

A collection of values returned by getTree.

Parameters

argument

Builder for com.pulumi.github.kotlin.inputs.GetTreePlainArgs.

See also