Created
April 23, 2019 17:41
-
-
Save alastairmccormack/a8c290738145f1c94a86029aca66cb8e to your computer and use it in GitHub Desktop.
One-liner Terraform external command to get current branch (No need to create additional script)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Branch name accessible via: ${data.external.git-branch.result.branch} | |
data "external" "git-branch" { | |
program = ["/bin/bash", "-c", "jq -n --arg branch `git rev-parse --abbrev-ref HEAD` '{\"branch\":$branch}'"] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment