@@ -29,13 +29,14 @@ jobs:
2929 repository : AdvancedPhotonSource/GSAS-II-tutorials.git
3030 path : _docs
3131 ref : main
32+ sparse-checkout : MDhelp/docs
33+ sparse-checkout-cone-mode : true
3234
3335 - name : Compare files
3436 id : compare
3537 run : |
36- # Check if any files in _docs/MDhelp/docs are newer than GSASII/help
37- # Since mkdocs converts all MD files to HTML, compare the most recent commit
38- # date in each directory
38+ # Check if any .md files in _docs/MDhelp/docs are newer than GSASII/help
39+ # Only compare markdown source files, not directory metadata
3940 files_changed="false"
4041
4142 if [ ! -d "GSASII/help" ]; then
@@ -45,22 +46,22 @@ jobs:
4546 echo "docs directory does not exist"
4647 files_changed="false"
4748 else
48- # Get the most recent commit date for the docs directory
49- docs_latest=$(cd _docs && git log -1 --format=%cI -- "MDhelp/docs/" 2>/dev/null || echo "" )
49+ # 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 )
5051
5152 # Get the most recent commit date for the help directory
5253 help_latest=$(git log -1 --format=%cI -- "GSASII/help/" 2>/dev/null || echo "")
5354
5455 if [ -z "$docs_latest" ]; then
55- echo "Could not get commit date for docs directory"
56+ echo "Could not get commit date for markdown files in docs directory"
5657 files_changed="false"
5758 elif [ -z "$help_latest" ]; then
5859 echo "help directory has no commit history, will build"
5960 files_changed="true"
6061 else
6162 # Compare ISO 8601 dates (they sort correctly as strings)
6263 if [ "$docs_latest" > "$help_latest" ]; then
63- echo "Docs directory is newer (docs: $docs_latest, help: $help_latest)"
64+ echo "Markdown docs are newer (docs: $docs_latest, help: $help_latest)"
6465 files_changed="true"
6566 else
6667 echo "help directory is current (docs: $docs_latest, help: $help_latest)"
0 commit comments