Skip to content

Commit 1a3d1ce

Browse files
jcklpeclaude
andcommitted
Fix role-pipeline-report cron firing daily instead of monthly
The schedule '0 10 1-7 * 1' mixed a day-of-month restriction (1-7) with a day-of-week restriction (1/Monday). Standard cron treats mixed day-of-month + day-of-week fields as OR, not AND, so this fired on every day 1-7 of the month AND every Monday instead of only the first Monday. Confirmed against run history: it posted to #t-engagement daily July 1-7 plus June 15/22/29. Switch to a plain weekly Monday cron and gate the actual report step on day-of-month <= 7 in the job itself, since cron can't express "first Monday of month" directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent f272ace commit 1a3d1ce

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/role-pipeline-report.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ name: Post open role pipeline report to Slack
22

33
on:
44
schedule:
5-
# First Monday of the month at 10am UTC
6-
- cron: '0 10 1-7 * 1'
5+
# Every Monday at 10am UTC — the job itself skips all but the first Monday
6+
# of the month. Cron can't express "first Monday" directly: mixing a
7+
# day-of-month restriction (1-7) with a day-of-week restriction (1) is
8+
# evaluated as OR, not AND, so '0 10 1-7 * 1' fires on every day 1-7 of
9+
# the month AND every Monday — this is what caused the daily spam.
10+
- cron: '0 10 * * 1'
711
workflow_dispatch:
812

913
env:
@@ -18,7 +22,16 @@ jobs:
1822
runs-on: ubuntu-latest
1923

2024
steps:
25+
- name: Skip unless first Monday of the month
26+
run: |
27+
DAY=$(date +%d)
28+
if [ "$((10#$DAY))" -gt 7 ]; then
29+
echo "Day of month is $DAY — not the first Monday. Skipping."
30+
echo "SKIP=true" >> "$GITHUB_ENV"
31+
fi
32+
2133
- name: Build and post role pipeline report
34+
if: env.SKIP != 'true'
2235
env:
2336
SLACK_WEBHOOK_ENGAGEMENT: ${{ secrets.SLACK_WEBHOOK_ENGAGEMENT }}
2437
run: |

0 commit comments

Comments
 (0)