Skip to content

Commit f2fe6b0

Browse files
andreubotellasideshowbarker
authored andcommitted
[gh-pages] Compute the specs' Date metadata from the git timestamps
1 parent bef0b5d commit f2fe6b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/build-specs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ jobs:
4545
run: |
4646
set -e
4747
for file in ./**/*.bs; do
48-
bikeshed -f spec "$file"
48+
# We use `date` to build a YYYY-MM-DD date rather than using git's
49+
# `--format=%as` because we want the date not to depend on the
50+
# committer's timezone. We use UTC to avoid depending on the build
51+
# runner's timezone as well.
52+
TIMESTAMP="$(git log -1 --format=%at "$file")"
53+
SHORT_DATE="$(date --date=@"$TIMESTAMP" --utc +%F)"
54+
bikeshed -f --md-date="$SHORT_DATE" spec "$file"
4955
done
5056
- name: Rename to index.html
5157
# The default pages for directories are assumed to be Overview.html, but

0 commit comments

Comments
 (0)