Skip to content

Commit ceba2fe

Browse files
Jammy2211Jammy2211claude
authored
feat(ci): optional lookback_hours override for arxiv digest manual dispatch (#59)
Lets a workflow_dispatch test-fire widen the window so it isn't hostage to today's (possibly empty) band; scheduled runs keep the weekday logic. Co-authored-by: Jammy2211 <JNightingale2211@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b5d93e0 commit ceba2fe

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/arxiv_papers.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ name: pyauto-arxiv-papers
2323
on:
2424
schedule:
2525
- cron: "0 6 * * 1-5"
26-
workflow_dispatch: {}
26+
workflow_dispatch:
27+
inputs:
28+
lookback_hours:
29+
description: "Override the look-back window (hours) for a manual test-fire. Blank = the normal weekday logic (24h, 72h on Mondays)."
30+
required: false
31+
default: ""
2732

2833
permissions:
2934
contents: read
@@ -50,11 +55,19 @@ jobs:
5055
# weekdays take the previous day (24 h). Windows anchored to wall-clock
5156
# `now`, so consecutive runs cover disjoint day-bands (gapless; cron
5257
# jitter yields at worst a rare boundary duplicate, never a gap).
53-
dow=$(date -u +%u) # 1=Mon … 7=Sun
54-
if [ "$dow" = "1" ]; then
55-
export LOOKBACK_HOURS=72
58+
# A manual dispatch may override the window (so a test-fire isn't
59+
# hostage to today's possibly-empty band); otherwise use the weekday
60+
# logic.
61+
override="${{ github.event.inputs.lookback_hours }}"
62+
if [ -n "$override" ]; then
63+
export LOOKBACK_HOURS="$override"
5664
else
57-
export LOOKBACK_HOURS=24
65+
dow=$(date -u +%u) # 1=Mon … 7=Sun
66+
if [ "$dow" = "1" ]; then
67+
export LOOKBACK_HOURS=72
68+
else
69+
export LOOKBACK_HOURS=24
70+
fi
5871
fi
5972
export UK_DATE="$(TZ=Europe/London date '+%Y-%m-%d (%a)')"
6073

0 commit comments

Comments
 (0)