Skip to content

Commit 920b595

Browse files
chore: wip
1 parent 6e03156 commit 920b595

1 file changed

Lines changed: 6 additions & 26 deletions

File tree

.github/workflows/buddy-bot.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Buddy Bot
22

33
on:
44
schedule:
5-
# Check for rebase requests every minute
6-
- cron: '*/20 * * * *'
5+
# Check for rebase requests every ~20 minutes (offset to avoid overlap with update/dashboard)
6+
- cron: '5,25,45 * * * *'
77
# Update dependencies every 2 hours
88
- cron: '0 */2 * * *'
99
# Update dashboard 15 minutes after dependency updates (ensures updates are reflected)
@@ -102,32 +102,12 @@ jobs:
102102
echo "run_dashboard=true" >> $GITHUB_OUTPUT
103103
fi
104104
elif [ "${{ github.event_name }}" = "schedule" ]; 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-
# Skip check at top of even hours when update job runs, to avoid
114-
# the check job auto-closing PRs that update just created.
115-
IS_UPDATE_TIME=false
116-
if [ "$MINUTE" -lt 5 ] && [ $((HOUR % 2)) -eq 0 ]; then
117-
IS_UPDATE_TIME=true
118-
fi
119-
120-
if [ $((MINUTE % 20)) -lt 5 ] && [ "$IS_UPDATE_TIME" = "false" ]; then
105+
# Determine based on cron schedule
106+
if [ "${{ github.event.schedule }}" = "5,25,45 * * * *" ]; then
121107
echo "run_check=true" >> $GITHUB_OUTPUT
122-
fi
123-
124-
# Dependency updates: top of every even hour
125-
if [ "$MINUTE" -lt 5 ] && [ $((HOUR % 2)) -eq 0 ]; then
108+
elif [ "${{ github.event.schedule }}" = "0 */2 * * *" ]; then
126109
echo "run_update=true" >> $GITHUB_OUTPUT
127-
fi
128-
129-
# Dashboard updates: ~15 minutes after dependency updates
130-
if [ "$MINUTE" -ge 10 ] && [ "$MINUTE" -lt 25 ] && [ $((HOUR % 2)) -eq 0 ]; then
110+
elif [ "${{ github.event.schedule }}" = "15 */2 * * *" ]; then
131111
echo "run_dashboard=true" >> $GITHUB_OUTPUT
132112
fi
133113
fi

0 commit comments

Comments
 (0)