get Repository Tree
The gitlab.getRepositoryTree
data source allows details of directories and files in a repository to be retrieved. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const this = gitlab.getRepositoryTree({
project: "example",
ref: "main",
path: "ExampleSubFolder",
recursive: true,
});
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
this = gitlab.get_repository_tree(project="example",
ref="main",
path="ExampleSubFolder",
recursive=True)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var @this = GitLab.GetRepositoryTree.Invoke(new()
{
Project = "example",
Ref = "main",
Path = "ExampleSubFolder",
Recursive = true,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v7/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.GetRepositoryTree(ctx, &gitlab.GetRepositoryTreeArgs{
Project: "example",
Ref: "main",
Path: pulumi.StringRef("ExampleSubFolder"),
Recursive: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetRepositoryTreeArgs;
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 this = GitlabFunctions.getRepositoryTree(GetRepositoryTreeArgs.builder()
.project("example")
.ref("main")
.path("ExampleSubFolder")
.recursive(true)
.build());
}
}
Content copied to clipboard
variables:
this:
fn::invoke:
Function: gitlab:getRepositoryTree
Arguments:
project: example
ref: main
path: ExampleSubFolder
recursive: true
Content copied to clipboard
Return
A collection of values returned by getRepositoryTree.
Parameters
argument
A collection of arguments for invoking getRepositoryTree.
suspend fun getRepositoryTree(path: String? = null, project: String, recursive: Boolean? = null, ref: String): GetRepositoryTreeResult
Return
A collection of values returned by getRepositoryTree.
Parameters
path
The path inside repository. Used to get content of subdirectories.
project
The ID or full path of the project owned by the authenticated user.
recursive
Boolean value used to get a recursive tree (false by default).
ref
The name of a repository branch or tag.
See also
suspend fun getRepositoryTree(argument: suspend GetRepositoryTreePlainArgsBuilder.() -> Unit): GetRepositoryTreeResult
Return
A collection of values returned by getRepositoryTree.
Parameters
argument
Builder for com.pulumi.gitlab.kotlin.inputs.GetRepositoryTreePlainArgs.