Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,36 @@ 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}')
# 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
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
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ jobs:
CONTAINER_ENGINE: docker
BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest

- 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" && "$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 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 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
# updated in the release PR before merge.
- name: Require release manifests to contain non-placeholder container image SHAs
Expand Down
2 changes: 1 addition & 1 deletion _posts/2024-04-10-release-0_5_1.md
Original file line number Diff line number Diff line change
@@ -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]
Expand Down