Skip to content

Is it possible to define environment variables as results of shell commands ? #1634

Answered by caarlos0
obourdon asked this question in Q&A
Discussion options

You must be logged in to vote

inside the yaml its not possible, no.

you can do it before running goreleaser though:

GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD || echo 'n/a') GIT_REVISION=$(git describe --always --tags --dirty || echo 'n/a') GO_BUILD_DATE=$(date -u +%FT%T) goreleaser release --rm-dist

also note that the revision and date are already available as template variables: https://goreleaser.com/customization/templates/

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by caarlos0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants