From 4dbd39ecbfbca617bc80419c69da0a6cd984a587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 13 Feb 2024 15:46:41 +0200 Subject: [PATCH] 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. --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0104605..ece01f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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