From 88241efe3ef8cc4c83611e3ef9f393dc83320aa8 Mon Sep 17 00:00:00 2001 From: Ted Date: Mon, 4 Aug 2025 18:09:33 +0800 Subject: [PATCH 1/2] fix: correct report filenames for releases --- .github/workflows/GenerateReport.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/GenerateReport.yml b/.github/workflows/GenerateReport.yml index 5dc73b5..a5662a9 100644 --- a/.github/workflows/GenerateReport.yml +++ b/.github/workflows/GenerateReport.yml @@ -300,7 +300,7 @@ jobs: id: find_latest_monthly run: | echo "🔍 Scanning for latest MonthlyReport..." - latest_file=$(find MonthlyReport -type f -name "MonthlyReport-*.xlsx" | sort | tail -n 1) + latest_file=$(find MonthlyReport -type f -name "MonthlyReport-*.xlsx" -printf '%T@ %p\n' | sort -n | tail -n 1 | cut -d' ' -f2-) if [[ -z "$latest_file" || ! -f "$latest_file" ]]; then echo "❌ No monthly report found." @@ -309,7 +309,7 @@ jobs: echo "✅ Found: $latest_file" - filename=$(basename "$latest_file") + filename=$(basename $latest_file) year_month=$(echo "$filename" | grep -oP '(?<=MonthlyReport-)[0-9]{6}') # Format month for display (e.g., "Jul 2025") @@ -416,7 +416,7 @@ jobs: run: | echo "📁 Scanning for latest report set..." - latest_csv=$(find WeeklyReport -type f -name "WeeklyReport_*.csv" | sort | tail -n 1) + latest_csv=$(find WeeklyReport -type f -name "WeeklyReport_*.csv" -printf '%T@ %p\n' | sort -n | tail -n 1 | cut -d' ' -f2-) if [[ -z "$latest_csv" || ! -f "$latest_csv" ]]; then echo "❌ No weekly CSV report found." @@ -433,11 +433,11 @@ jobs: echo "📄 JSON: $json_file" echo "CSV_PATH=$latest_csv" >> $GITHUB_ENV - echo "CSV_FILENAME=$(basename \"$latest_csv\")" >> $GITHUB_ENV + echo "CSV_FILENAME=$(basename $latest_csv)" >> $GITHUB_ENV if [[ -f "$html_file" ]]; then echo "HTML_PATH=$html_file" >> $GITHUB_ENV - echo "HTML_FILENAME=$(basename \"$html_file\")" >> $GITHUB_ENV + echo "HTML_FILENAME=$(basename $html_file)" >> $GITHUB_ENV else echo "⚠️ HTML report not found: $html_file" echo "HTML_PATH=" >> $GITHUB_ENV @@ -446,7 +446,7 @@ jobs: if [[ -f "$json_file" ]]; then echo "JSON_PATH=$json_file" >> $GITHUB_ENV - echo "JSON_FILENAME=$(basename \"$json_file\")" >> $GITHUB_ENV + echo "JSON_FILENAME=$(basename $json_file)" >> $GITHUB_ENV else echo "⚠️ JSON report not found: $json_file" echo "JSON_PATH=" >> $GITHUB_ENV From ecb5d0efa7a909858ce9f9ed193d04de2e69ca02 Mon Sep 17 00:00:00 2001 From: Ted Date: Mon, 4 Aug 2025 18:11:08 +0800 Subject: [PATCH 2/2] Update GenerateReport.yml --- .github/workflows/GenerateReport.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/GenerateReport.yml b/.github/workflows/GenerateReport.yml index a5662a9..686fd42 100644 --- a/.github/workflows/GenerateReport.yml +++ b/.github/workflows/GenerateReport.yml @@ -293,8 +293,8 @@ jobs: run: | git init git remote add origin https://github.com/${{ github.repository }} - git fetch origin dev - git checkout origin/dev + git fetch origin main + git checkout origin/main - name: Find latest monthly report id: find_latest_monthly @@ -408,8 +408,8 @@ jobs: run: | git init git remote add origin https://github.com/${{ github.repository }} - git fetch origin dev - git checkout origin/dev + git fetch origin main + git checkout origin/main - name: Find latest report set id: find_latest