!git.sha
The !git.sha Atmos YAML function returns the full commit SHA of the current Git HEAD.
Usage
# Get the current HEAD commit SHA.
# If the SHA cannot be resolved, it returns a default value if specified; otherwise, it returns an error.
!git.sha <default-value>
Examples
vars:
build_sha: !git.sha
# With a fallback value when the SHA cannot be resolved (e.g. not a Git repository).
build_sha_safe: !git.sha unknown
Related Functions
!git.ref— alias of!git.sha, intended for source-pinning use cases!git.branch— the current branch name!git.repository— the full<owner>/<name>slug