The gitlab_repository_file
data source allows details of a file in a repository to be retrieved.
Upstream API: GitLab REST API docs
data "gitlab_repository_file" "example" {
project = "example"
ref = "main"
file_path = "README.md"
}
file_path
(String) The full path of the file. It must be relative to the root of the project without a leading slash /
or ./
.project
(String) The name or ID of the project.ref
(String) The name of branch, tag or commit.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. Note: requires GitLab 14.10 or newer.file_name
(String) The filename.id
(String) The ID of this resource.last_commit_id
(String) The last known commit id.size
(Number) The file size.