From c2662020b0cf8c1667352d7390728b4a831c9fa7 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Sun, 19 Oct 2025 15:57:44 +0100 Subject: [PATCH] fix change selector in workflow --- .gitea/workflows/mvs_job.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/mvs_job.yaml b/.gitea/workflows/mvs_job.yaml index 2c5c313..0148c92 100644 --- a/.gitea/workflows/mvs_job.yaml +++ b/.gitea/workflows/mvs_job.yaml @@ -11,6 +11,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history for git diff - name: Prepare environment id: setup @@ -42,8 +44,9 @@ jobs: # Fallback to all .c/.bas files if no changes or no previous commit if [ -z "$CHANGED_FILES" ]; then echo "=== Debug: No changes found; running fallback find ===" - CHANGED_FILES=$(find . -type f \( -name "*.c" -o -name "*.bas" \) | head -1) - echo "Fallback files: '${CHANGED_FILES}'" + # Find newest .c/.bas by modification time (sort -nr on %T@ timestamp) + CHANGED_FILES=$(find . -type f \( -name "*.c" -o -name "*.bas" \) -printf '%T@ %p\n' 2>/dev/null | sort -nr | cut -d' ' -f2- | head -1) + echo "Fallback files (newest first): '${CHANGED_FILES}'" echo "=== Debug: Fallback complete ===" fi @@ -75,4 +78,4 @@ jobs: - name: Report Status run: | - echo "Upload/Compile complete! Check TK5 JES for JOB ${{ steps.files.outputs.member }} output." + echo "Upload/Compile complete! Check TK5 JES for JOB ${{ steps.files.outputs.member }} output." \ No newline at end of file