diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 38f6307520..13ccb7e58a 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -30,9 +30,10 @@ rm -f $HOME/.bazelrc # --nostamp is required for better caching (only on non-release jobs). if [ "$BUILDKITE_PIPELINE_SLUG" == "scion" ]; then echo "build --nostamp" > $HOME/.bazelrc - # Also set a fixed GIT_VERSION so that the workspace_status_command always - # returns the same value on CI to improve cache reuse. - export GIT_VERSION="ci-fixed" + # Shorten the git version to omit commit information, improving cache reuse. + # The format of git-version is "--" + # This will be shortened to "-modified-ci" + export GIT_VERSION=$(tools/git-version | sed 's/-.*/-modified-ci/') else echo "build --stamp" > $HOME/.bazelrc fi