Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/nasr-cycle-watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading