github: Properly propagate BUILD_DATE to BUILD_DATE_UNIX

Previously, when echoing the definition of BUILD_DATE to
$GITHUB_OUTPUT, that doesn't make it available as an environment
variable. (And if it would be echoed to $GITHUB_ENV, it still
wouldn't take effect until the next step within the same job either.)

Therefore, this previously set BUILD_DATE to $(date -d "" +%s),
which seems to produce a timestamp corresponding to the start of
the current day.
This commit is contained in:
Martin Storsjö committed 2024-02-13 15:48:27 +02:00
1 parent 3ed3b66ea3
commit 4dbd39ecbf
1 file changed
+2 -1
+2 -1
View File
@@ -43,7 +43,8 @@ jobs:
fi
echo TAG=$TAG >> $GITHUB_OUTPUT
echo COMMIT_DATE_UNIX=$(git log -1 --pretty=%ct $GITHUB_SHA) >> $GITHUB_OUTPUT
echo BUILD_DATE=$(date -u '+%FT%TZ') >> $GITHUB_OUTPUT
BUILD_DATE=$(date -u '+%FT%TZ')
echo BUILD_DATE=${BUILD_DATE} >> $GITHUB_OUTPUT
echo BUILD_DATE_UNIX=$(date -d "${BUILD_DATE}" +%s) >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
cat $GITHUB_OUTPUT >> parameters.txt