Skip to content

Commit 4dbd39e

Browse files
committed
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.
1 parent 3ed3b66 commit 4dbd39e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343
fi
4444
echo TAG=$TAG >> $GITHUB_OUTPUT
4545
echo COMMIT_DATE_UNIX=$(git log -1 --pretty=%ct $GITHUB_SHA) >> $GITHUB_OUTPUT
46-
echo BUILD_DATE=$(date -u '+%FT%TZ') >> $GITHUB_OUTPUT
46+
BUILD_DATE=$(date -u '+%FT%TZ')
47+
echo BUILD_DATE=${BUILD_DATE} >> $GITHUB_OUTPUT
4748
echo BUILD_DATE_UNIX=$(date -d "${BUILD_DATE}" +%s) >> $GITHUB_OUTPUT
4849
cat $GITHUB_OUTPUT
4950
cat $GITHUB_OUTPUT >> parameters.txt

0 commit comments

Comments
 (0)