Skip to content

Commit

Permalink
Set git revision at build from env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples committed Jan 28, 2022
1 parent f9c6ddf commit 8e4b82d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion develop/scripts/create_build_info_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ set -eu

build_info_data_file="build/info/data.json"

git_revision=$(git rev-parse --short HEAD) # "6cbfa2a3a"
git_revision=${GITHUB_SHA_SHORT-}
if [ -z "${git_revision}" ]; then
git_revision=$(git rev-parse --short HEAD) # "6cbfa2a3a"
fi

build_time_unix=$(date '+%s') # seconds since epoch

echo '{"gitRevision":"'"${git_revision}"'","buildTimeUnix":'"${build_time_unix}"'}' > "${build_info_data_file}"

0 comments on commit 8e4b82d

Please sign in to comment.