Skip to content

Commit b9ff3ef

Browse files
committed
Compare docs changes against last release tag instead of 24h window
Uses the most recent vyyyy-mm-dd release tag as the baseline for change detection. This avoids missing changes if a scheduled run is skipped due to runner outages or cron delays.
1 parent b7ec075 commit b9ff3ef

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/docs-release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ jobs:
2828
exit 0
2929
fi
3030
31-
# For scheduled runs, check if docs/ or html/docs/ changed in the last 24 hours
32-
LAST_CHANGE=$(git log --since="24 hours ago" --format="%H" -- docs/ html/docs/ | head -1)
33-
if [ -n "$LAST_CHANGE" ]; then
31+
# For scheduled runs, compare against the last release tag
32+
LAST_TAG=$(git tag --list 'v[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' --sort=-version:refname | head -1)
33+
if [ -z "$LAST_TAG" ]; then
3434
echo "changed=true" >> "$GITHUB_OUTPUT"
35-
echo "Changes detected in docs/ or html/docs/."
35+
echo "No previous release tag found — building unconditionally."
36+
exit 0
37+
fi
38+
39+
DIFF=$(git diff --name-only "$LAST_TAG"..HEAD -- docs/ html/docs/)
40+
if [ -n "$DIFF" ]; then
41+
echo "changed=true" >> "$GITHUB_OUTPUT"
42+
echo "Changes detected since $LAST_TAG in docs/ or html/docs/."
3643
else
3744
echo "changed=false" >> "$GITHUB_OUTPUT"
38-
echo "No changes detected — skipping release."
45+
echo "No changes since $LAST_TAG — skipping release."
3946
fi
4047
4148
- name: Set date tag

0 commit comments

Comments
 (0)