git-info

Invicton-Labs/git-info/external

Terraform Module HCL EXTERNAL

Retrieves Git info for a given repository.

Install
module "git-info" {
source = "Invicton-Labs/git-info/external"
version = "0.2.3"
}
plain text: /constructs/tfmod-invicton-labs-git-info-external/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform - Git Info Retrieves Git info for a given repository. It can retrieve: - Whether the given directory is a Git repository - The hash of the currently checked out commit (both full length and short version) - The currently checked out branch - A list of all local branches - A list of all remote branches - The currently checked out tag (if the currently checked out commit was tagged) - A list of all tags - A list of all remotes, along with their fetch and push URLs Additionally, it can optionally fetch or pull from the remote prior to getting this metadata (so you can be sure the results are always up-to-date). Each of these features can be optionally disabled with an input variable (each one defaults to being enabled) if you want to disable a feature that may not work for your part

Inputs (10)
NameTypeDescriptionDefault
pullboolWhether to run `git pull` prior to reading the Git metadata.false
get_local_branchesboolWhether to get a list of all local branches.true
get_remote_branchesboolWhether to get a list of all remote branches.true
get_commit_hashboolWhether to get the hash of the currently checked out commit.true
get_current_tagsboolWhether to get the list of tags associated with the currently checked out committrue
get_tagsboolWhether to get a list of all tags in the repository.true
working_dirstringThe working directory to use for determining Git information. Defaults to `path.null
get_current_branchboolWhether to get the currently checked out branch.true
get_remotesboolWhether to get a list of all available remotes and their fetch/push URLs.true
fetchboolWhether to run `git fetch` prior to reading the Git metadata.false
Outputs (9)
is_git — Whether the directory is a Git repository.
current_branch — The branch that is currently checked out. If the working directory is not a Git directory, this will
local_branches — A list of local branch names. If the working directory is not a Git directory, this will be `null`.
remotes — A map of remotes. The keys are the remote names (e.g. "origin"), and the values are maps with `fetch
remote_branches — A map of remote names to a list of branches on that remote. If the working directory is not a Git di
commit_hash — The commit hash that is currently checked out. If the working directory is not a Git directory, this
commit_hash_short — The commit hash (short version, first 7 characters) that is currently checked out. If the working di
current_tags — All tags associated with the currently checked out commit. If the working directory is not a Git dir
tags — A map of tags for this repository. Keys are tag names, values are the corresponding hashes (hashes o
Details
FrameworkTerraform Module
LanguageHCL
Version0.2.3
Cloud EXTERNAL
Total downloads1.4k
Inputs10
Outputs9
NamespaceInvicton-Labs
Updated