diff --git a/.github/workflows/nasr-cycle-watch.yml b/.github/workflows/nasr-cycle-watch.yml index 0ea5672..eef77a7 100644 --- a/.github/workflows/nasr-cycle-watch.yml +++ b/.github/workflows/nasr-cycle-watch.yml @@ -6,7 +6,9 @@ name: NASR Cycle Watch on: schedule: - - cron: "0 16 * * *" + # Mondays. The FAA posts a cycle about 29 days ahead, so a weekly poll finds it within a week + # and still has two weeks of margin before the overdue alert. + - cron: "0 16 * * 1" workflow_dispatch: inputs: cycle: @@ -95,11 +97,11 @@ jobs: available=false fi - published=$(grep -i '^last-modified:' txt.headers | tail -n 1 | cut -d' ' -f2- | tr -d '\r') + published=$({ grep -i '^last-modified:' txt.headers || true; } | tail -n 1 | cut -d' ' -f2- | tr -d '\r') days_out=$(( ( $(date -u -d "$CYCLE" +%s) - $(date -u +%s) ) / 86400 )) # Publication runs ~29 days ahead; still missing two weeks out means the FAA slipped or - # the URLs moved, either of which otherwise looks like an ordinary quiet day. + # the URLs moved, either of which otherwise looks like an ordinary quiet poll. if [ "$available" != "true" ] && [ "$days_out" -le 14 ]; then overdue=true else @@ -315,7 +317,7 @@ jobs: - name: Upload the report # Uploaded before anything reads it, and on failure too: this artifact is also the record - # that the cycle was checked, so a broken cycle is reported once rather than every day. + # that the cycle was checked, so a broken cycle is reported once rather than on every poll. if: always() uses: actions/upload-artifact@v7.0.2 with: