From c12f0a955f2dd3a0418e930727fc1687b01587d4 Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Wed, 4 Mar 2026 14:55:48 +1300 Subject: [PATCH 1/5] Warn in job summary when future-dated posts are deployed When a push to main includes future-dated posts, the deploy workflow now adds a warning to the GitHub Actions job summary listing the affected posts and their publish dates, with a reminder to re-run the workflow manually on the publish date. Both the filename date and front matter date are checked, using whichever is later. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Sam Barker --- .github/workflows/jekyll-gh-pages.yml | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 0eee0660..3864de00 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -70,6 +70,34 @@ jobs: CONTAINER_ENGINE: docker CONFIG_OVERRIDES: _config-overrides.yml BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest + - name: Warn about future-dated posts + run: | + today=$(date -u +%Y-%m-%d) + future_posts=() + for post in _posts/*.md; do + filename=$(basename "$post") + file_date=$(echo "$filename" | grep -oP '^\d{4}-\d{2}-\d{2}') + front_matter_date=$(grep -oP '^date:\s*\K\d{4}-\d{2}-\d{2}' "$post" || true) + # Use whichever date is later + if [[ -n "$front_matter_date" && "$front_matter_date" > "$file_date" ]]; then + post_date="$front_matter_date" + else + post_date="$file_date" + fi + if [[ -n "$post_date" && "$post_date" > "$today" ]]; then + future_posts+=("$filename (publishes $post_date)") + fi + done + if [[ ${#future_posts[@]} -gt 0 ]]; then + echo "## ⚠️ Future-dated posts detected" >> "$GITHUB_STEP_SUMMARY" + echo "The following posts will not appear until the site is rebuilt on or after their publish date:" >> "$GITHUB_STEP_SUMMARY" + for post in "${future_posts[@]}"; do + echo "- $post" >> "$GITHUB_STEP_SUMMARY" + done + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "Re-run this workflow manually on the publish date to make them live." >> "$GITHUB_STEP_SUMMARY" + fi + - name: Upload artifact # Automatically uploads an artifact from the './_site' directory by default uses: actions/upload-pages-artifact@v3 From d168949958ae8b18a7da0bf77dfdde3fdb40639e Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Wed, 4 Mar 2026 14:56:34 +1300 Subject: [PATCH 2/5] Validate post filename and front matter dates match on PR Adds a PR check that fails if any post in _posts/ has a filename date that doesn't match the date in its front matter, catching accidental mismatches early. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Sam Barker --- .github/workflows/pr-build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index b655f5c7..4f291320 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -39,6 +39,27 @@ jobs: CONTAINER_ENGINE: docker BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest + - name: Require post filename and front matter dates to match + run: | + mismatches=() + for post in _posts/*.md; do + filename=$(basename "$post") + file_date=$(echo "$filename" | grep -oP '^\d{4}-\d{2}-\d{2}') + front_matter_date=$(grep -oP '^date:\s*\K\d{4}-\d{2}-\d{2}' "$post" || true) + if [[ -n "$file_date" && -n "$front_matter_date" && "$file_date" != "$front_matter_date" ]]; then + mismatches+=("$filename: filename date=$file_date, front matter date=$front_matter_date") + fi + done + if [[ ${#mismatches[@]} -gt 0 ]]; then + echo "Error: post filename and front matter dates do not match:" >&2 + for mismatch in "${mismatches[@]}"; do + echo " $mismatch" >&2 + done + exit 1 + else + echo "Success: all post filename and front matter dates match" + fi + # Currently the image shas are not available when we create the release, they need to be manually # updated in the release PR before merge. - name: Require release manifests to contain non-placeholder container image SHAs From 8ab50ba3aa2403917bf4898b49f12d80caee7539 Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Wed, 4 Mar 2026 16:13:45 +1300 Subject: [PATCH 3/5] Relax post date check to allow front matter date newer than filename Rather than requiring an exact match, only fail if the front matter date is older than the filename date, which is the case that would cause Jekyll to publish later than expected. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Sam Barker --- .github/workflows/pr-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 4f291320..0c4225ab 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -39,25 +39,25 @@ jobs: CONTAINER_ENGINE: docker BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest - - name: Require post filename and front matter dates to match + - name: Require post front matter date is not older than filename date run: | mismatches=() for post in _posts/*.md; do filename=$(basename "$post") file_date=$(echo "$filename" | grep -oP '^\d{4}-\d{2}-\d{2}') front_matter_date=$(grep -oP '^date:\s*\K\d{4}-\d{2}-\d{2}' "$post" || true) - if [[ -n "$file_date" && -n "$front_matter_date" && "$file_date" != "$front_matter_date" ]]; then + if [[ -n "$file_date" && -n "$front_matter_date" && "$front_matter_date" < "$file_date" ]]; then mismatches+=("$filename: filename date=$file_date, front matter date=$front_matter_date") fi done if [[ ${#mismatches[@]} -gt 0 ]]; then - echo "Error: post filename and front matter dates do not match:" >&2 + echo "Error: post front matter date is older than filename date:" >&2 for mismatch in "${mismatches[@]}"; do echo " $mismatch" >&2 done exit 1 else - echo "Success: all post filename and front matter dates match" + echo "Success: all post front matter dates are consistent with filename dates" fi # Currently the image shas are not available when we create the release, they need to be manually From 0317f69a002fe6d322ca9ca0fdbe4dba54cc505c Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Wed, 4 Mar 2026 16:38:58 +1300 Subject: [PATCH 4/5] align frontmatter with filename Signed-off-by: Sam Barker --- _posts/2024-04-10-release-0_5_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2024-04-10-release-0_5_1.md b/_posts/2024-04-10-release-0_5_1.md index 137687ca..e0e667b7 100644 --- a/_posts/2024-04-10-release-0_5_1.md +++ b/_posts/2024-04-10-release-0_5_1.md @@ -1,7 +1,7 @@ --- layout: post title: "Kroxylicious release 0.5.1" -date: 2024-04-09 20:00:00 +0000 +date: 2024-04-10 20:00:00 +0000 author: "Sam Barker" author_url: "https://www.github.com/sambarker" categories: [releases, kroxylicious, record-encryption] From 3c154ec224f6d6c9ddcaf233d41ca2539e750b4f Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Mon, 9 Mar 2026 10:11:38 +1300 Subject: [PATCH 5/5] Fix future-post warning to properly account for timezones Previously the check only extracted YYYY-MM-DD from the front matter date, silently discarding any time and timezone offset. This caused false positives for NZ-timezone posts (e.g. "2026-03-05 00:00:00 +1300" is 2026-03-04 in UTC, but the check treated it as March 5) and false negatives for posts with negative UTC offsets. Now the full front matter date value is passed to GNU date with -u -d to get the correct UTC date, matching Jekyll's own behaviour. Assisted-by: Claude Sonnet 4.6 Signed-off-by: Sam Barker --- .github/workflows/jekyll-gh-pages.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 3864de00..b1dd6932 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -77,10 +77,12 @@ jobs: for post in _posts/*.md; do filename=$(basename "$post") file_date=$(echo "$filename" | grep -oP '^\d{4}-\d{2}-\d{2}') - front_matter_date=$(grep -oP '^date:\s*\K\d{4}-\d{2}-\d{2}' "$post" || true) - # Use whichever date is later - if [[ -n "$front_matter_date" && "$front_matter_date" > "$file_date" ]]; then - post_date="$front_matter_date" + # Extract the full front matter date value (may include time and timezone offset) + # and convert to a UTC date so that e.g. "2026-03-05 00:00:00 +1300" is + # correctly treated as 2026-03-04 in UTC (matching Jekyll's behaviour). + front_matter_raw=$(grep -oP '^date:\s*\K.+' "$post" | xargs 2>/dev/null || true) + if [[ -n "$front_matter_raw" ]]; then + post_date=$(date -u -d "$front_matter_raw" +%Y-%m-%d 2>/dev/null || echo "$file_date") else post_date="$file_date" fi