From fcaa267a0614fdd4c816422e5d83c6bda5f6aa1d Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 5 Jul 2021 06:28:42 -0700 Subject: [PATCH] Sanitize git log output used in for Go release template The Go release system uses a `git log` command to determine the commit in order to populate the output of the application's `version` command. The expected output of the command is solely the short hash. With the previous command, that expectation was not realized under the following conditions: - The `log.showSignature` Git configuration option is set to true. - The commit being built was signed (as is always the case when a commit is made via the GitHub web interface). In this case, the signing information is shown in addition to the hash, breaking the build system. --- workflow-templates/assets/release-go-task/Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow-templates/assets/release-go-task/Taskfile.yml b/workflow-templates/assets/release-go-task/Taskfile.yml index b8af097b..1bc2565d 100644 --- a/workflow-templates/assets/release-go-task/Taskfile.yml +++ b/workflow-templates/assets/release-go-task/Taskfile.yml @@ -10,7 +10,7 @@ vars: DIST_DIR: "dist" # build vars COMMIT: - sh: echo "$(git log -n 1 --format=%h)" + sh: echo "$(git log --no-show-signature -n 1 --format=%h)" TIMESTAMP: sh: echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" TIMESTAMP_SHORT: