git-info
Invicton-Labs/git-info/external
Retrieves Git info for a given repository.
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
| Name | Type | Description | Default |
|---|---|---|---|
| pull | bool | Whether to run `git pull` prior to reading the Git metadata. | false |
| get_local_branches | bool | Whether to get a list of all local branches. | true |
| get_remote_branches | bool | Whether to get a list of all remote branches. | true |
| get_commit_hash | bool | Whether to get the hash of the currently checked out commit. | true |
| get_current_tags | bool | Whether to get the list of tags associated with the currently checked out commit | true |
| get_tags | bool | Whether to get a list of all tags in the repository. | true |
| working_dir | string | The working directory to use for determining Git information. Defaults to `path. | null |
| get_current_branch | bool | Whether to get the currently checked out branch. | true |
| get_remotes | bool | Whether to get a list of all available remotes and their fetch/push URLs. | true |
| fetch | bool | Whether to run `git fetch` prior to reading the Git metadata. | false |
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 willlocal_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 `fetchremote_branches — A map of remote names to a list of branches on that remote. If the working directory is not a Git dicommit_hash — The commit hash that is currently checked out. If the working directory is not a Git directory, thiscommit_hash_short — The commit hash (short version, first 7 characters) that is currently checked out. If the working dicurrent_tags — All tags associated with the currently checked out commit. If the working directory is not a Git dirtags — A map of tags for this repository. Keys are tag names, values are the corresponding hashes (hashes o