Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
The gitlab.RepositoryFile data source allows details of a file 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 example = gitlab.getRepositoryFile({
project: "example",
ref: "main",
filePath: "README.md",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.get_repository_file(project="example",
ref="main",
file_path="README.md")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.LookupRepositoryFile(ctx, &gitlab.LookupRepositoryFileArgs{
Project: "example",
Ref: "main",
FilePath: "README.md",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = GitLab.GetRepositoryFile.Invoke(new()
{
Project = "example",
Ref = "main",
FilePath = "README.md",
});
});
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.GetRepositoryFileArgs;
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 example = GitlabFunctions.getRepositoryFile(GetRepositoryFileArgs.builder()
.project("example")
.ref("main")
.filePath("README.md")
.build());
}
}
variables:
example:
fn::invoke:
function: gitlab:getRepositoryFile
arguments:
project: example
ref: main
filePath: README.md
Using getRepositoryFile
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRepositoryFile(args: GetRepositoryFileArgs, opts?: InvokeOptions): Promise<GetRepositoryFileResult>
function getRepositoryFileOutput(args: GetRepositoryFileOutputArgs, opts?: InvokeOptions): Output<GetRepositoryFileResult>def get_repository_file(file_path: Optional[str] = None,
project: Optional[str] = None,
ref: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRepositoryFileResult
def get_repository_file_output(file_path: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
ref: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryFileResult]func LookupRepositoryFile(ctx *Context, args *LookupRepositoryFileArgs, opts ...InvokeOption) (*LookupRepositoryFileResult, error)
func LookupRepositoryFileOutput(ctx *Context, args *LookupRepositoryFileOutputArgs, opts ...InvokeOption) LookupRepositoryFileResultOutput> Note: This function is named LookupRepositoryFile in the Go SDK.
public static class GetRepositoryFile
{
public static Task<GetRepositoryFileResult> InvokeAsync(GetRepositoryFileArgs args, InvokeOptions? opts = null)
public static Output<GetRepositoryFileResult> Invoke(GetRepositoryFileInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRepositoryFileResult> getRepositoryFile(GetRepositoryFileArgs args, InvokeOptions options)
public static Output<GetRepositoryFileResult> getRepositoryFile(GetRepositoryFileArgs args, InvokeOptions options)
fn::invoke:
function: gitlab:index/getRepositoryFile:getRepositoryFile
arguments:
# arguments dictionaryThe following arguments are supported:
getRepositoryFile Result
The following output properties are available:
- Blob
Id string - The blob id.
- Commit
Id string - The commit id.
- Content string
- File content.
- Content
Sha256 string - File content sha256 digest.
- Encoding string
- The file content encoding.
- Execute
Filemode bool - Enables or disables the execute flag on the file.
- File
Name string - The filename.
- File
Path string - The full path of the file. It must be relative to the root of the project without a leading slash
/or./. - Id string
- The ID of this datasource. In the format
<project:ref:file_path>. - Last
Commit stringId - The last known commit id.
- Project string
- The name or ID of the project.
- Ref string
- The name of branch, tag or commit.
- Size int
- The file size.
- Blob
Id string - The blob id.
- Commit
Id string - The commit id.
- Content string
- File content.
- Content
Sha256 string - File content sha256 digest.
- Encoding string
- The file content encoding.
- Execute
Filemode bool - Enables or disables the execute flag on the file.
- File
Name string - The filename.
- File
Path string - The full path of the file. It must be relative to the root of the project without a leading slash
/or./. - Id string
- The ID of this datasource. In the format
<project:ref:file_path>. - Last
Commit stringId - The last known commit id.
- Project string
- The name or ID of the project.
- Ref string
- The name of branch, tag or commit.
- Size int
- The file size.
- blob
Id String - The blob id.
- commit
Id String - The commit id.
- content String
- File content.
- content
Sha256 String - File content sha256 digest.
- encoding String
- The file content encoding.
- execute
Filemode Boolean - Enables or disables the execute flag on the file.
- file
Name String - The filename.
- file
Path String - The full path of the file. It must be relative to the root of the project without a leading slash
/or./. - id String
- The ID of this datasource. In the format
<project:ref:file_path>. - last
Commit StringId - The last known commit id.
- project String
- The name or ID of the project.
- ref String
- The name of branch, tag or commit.
- size Integer
- The file size.
- blob
Id string - The blob id.
- commit
Id string - The commit id.
- content string
- File content.
- content
Sha256 string - File content sha256 digest.
- encoding string
- The file content encoding.
- execute
Filemode boolean - Enables or disables the execute flag on the file.
- file
Name string - The filename.
- file
Path string - The full path of the file. It must be relative to the root of the project without a leading slash
/or./. - id string
- The ID of this datasource. In the format
<project:ref:file_path>. - last
Commit stringId - The last known commit id.
- project string
- The name or ID of the project.
- ref string
- The name of branch, tag or commit.
- size number
- The file size.
- blob_
id str - The blob id.
- commit_
id str - The commit id.
- content str
- File content.
- content_
sha256 str - File content sha256 digest.
- encoding str
- The file content encoding.
- execute_
filemode bool - Enables or disables the execute flag on the file.
- file_
name str - The filename.
- file_
path str - The full path of the file. It must be relative to the root of the project without a leading slash
/or./. - id str
- The ID of this datasource. In the format
<project:ref:file_path>. - last_
commit_ strid - The last known commit id.
- project str
- The name or ID of the project.
- ref str
- The name of branch, tag or commit.
- size int
- The file size.
- blob
Id String - The blob id.
- commit
Id String - The commit id.
- content String
- File content.
- content
Sha256 String - File content sha256 digest.
- encoding String
- The file content encoding.
- execute
Filemode Boolean - Enables or disables the execute flag on the file.
- file
Name String - The filename.
- file
Path String - The full path of the file. It must be relative to the root of the project without a leading slash
/or./. - id String
- The ID of this datasource. In the format
<project:ref:file_path>. - last
Commit StringId - The last known commit id.
- project String
- The name or ID of the project.
- ref String
- The name of branch, tag or commit.
- size Number
- The file size.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
