Skip to content

Commit d2b6400

Browse files
committed
more CoPilot fixes for help html gen workflow
1 parent 4550265 commit d2b6400

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/update_help.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
files_changed="false"
4848
else
4949
# Get the most recent commit date for .md files in docs directory
50-
docs_latest=$(cd _docs && find MDhelp/docs -name "*.md" -type f | xargs git log -1 --format=%cI -- 2>/dev/null | sort -r | head -1)
50+
docs_latest=$(cd _docs && git ls-tree --name-only -r HEAD -- MDhelp/docs | grep '\.md$' | while read filename; do echo "$(git log -1 --format="%ai" -- "$filename") $filename"; done | sort -r | head -1 | cut -d' ' -f1-3)
5151
5252
# Get the most recent commit date for the help directory
53-
help_latest=$(git log -1 --format=%cI -- "GSASII/help/" 2>/dev/null || echo "")
53+
help_latest=$(git ls-tree --name-only -r HEAD -- GSASII/help | while read filename; do echo "$(git log -1 --format="%ai" -- "$filename") $filename"; done | sort -r | head -1 | cut -d' ' -f1-3)
5454
5555
if [ -z "$docs_latest" ]; then
5656
echo "Could not get commit date for markdown files in docs directory"
@@ -59,8 +59,11 @@ jobs:
5959
echo "help directory has no commit history, will build"
6060
files_changed="true"
6161
else
62-
# Compare ISO 8601 dates (they sort correctly as strings)
63-
if [ "$docs_latest" > "$help_latest" ]; then
62+
# Convert dates to epoch seconds for reliable numeric comparison
63+
docs_epoch=$(date -d "$docs_latest" +%s 2>/dev/null || echo 0)
64+
help_epoch=$(date -d "$help_latest" +%s 2>/dev/null || echo 0)
65+
66+
if [ "$docs_epoch" -gt "$help_epoch" ]; then
6467
echo "Markdown docs are newer (docs: $docs_latest, help: $help_latest)"
6568
files_changed="true"
6669
else

0 commit comments

Comments
 (0)