Skip to content

Commit 01f5611

Browse files
chore: wip
1 parent a5e88fd commit 01f5611

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/buddy-bot.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,25 @@ jobs:
102102
echo "run_dashboard=true" >> $GITHUB_OUTPUT
103103
fi
104104
elif [ "${{ github.event_name }}" = "schedule" ]; then
105-
# Determine based on cron schedule
106-
if [ "${{ github.event.schedule }}" = "*/20 * * * *" ]; then
105+
# Use current UTC time to determine which jobs to run.
106+
# github.event.schedule is unreliable when multiple cron schedules
107+
# overlap (e.g. */20 and 0 */2 both fire at :00) — GitHub picks one
108+
# arbitrarily, causing jobs to be skipped.
109+
MINUTE=$(date -u +%-M)
110+
HOUR=$(date -u +%-H)
111+
112+
# Rebase check: every 20 minutes (minute 0, 20, or 40)
113+
if [ $((MINUTE % 20)) -lt 5 ]; then
107114
echo "run_check=true" >> $GITHUB_OUTPUT
108-
elif [ "${{ github.event.schedule }}" = "0 */2 * * *" ]; then
115+
fi
116+
117+
# Dependency updates: top of every even hour
118+
if [ "$MINUTE" -lt 5 ] && [ $((HOUR % 2)) -eq 0 ]; then
109119
echo "run_update=true" >> $GITHUB_OUTPUT
110-
elif [ "${{ github.event.schedule }}" = "15 */2 * * *" ]; then
120+
fi
121+
122+
# Dashboard updates: ~15 minutes after dependency updates
123+
if [ "$MINUTE" -ge 10 ] && [ "$MINUTE" -lt 25 ] && [ $((HOUR % 2)) -eq 0 ]; then
111124
echo "run_dashboard=true" >> $GITHUB_OUTPUT
112125
fi
113126
fi

0 commit comments

Comments
 (0)