ci/build: split git commit sha command out of echo

This prevents errors from being masked, eg. when `git` is not installed.

While at it, use `--short=10` instead of piping through `cut`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34710>
This commit is contained in:
Eric Engestrom 2025-04-21 21:46:26 +02:00 committed by Marge Bot
parent 621aebe046
commit 8c28f77bd1

View file

@ -32,7 +32,8 @@ fi
# Test runs don't pull down the git tree, so put the dEQP helper
# script and associated bits there.
echo "$(cat VERSION) (git-$(git rev-parse HEAD | cut -b -10))" > install/VERSION
git_sha=$(git rev-parse --short=10 HEAD)
echo "$(cat VERSION) (git-$git_sha)" > install/VERSION
cp -Rp .gitlab-ci/bare-metal install/
cp -Rp .gitlab-ci/common install/
cp -Rp .gitlab-ci/piglit install/