Skip to content

Commit 491d69f

Browse files
committed
fix OCW workflows to run monthly
1 parent 4afc73d commit 491d69f

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

.github/workflows/ocwm-creator.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Create OCWM Monthly
22

33
on:
44
schedule:
5-
- cron: "0 9 15-21 * 2" # Runs at 9:00 AM on the 3rd Tuesday of the month
5+
- cron: "0 9 * * 2" # Runs at 9:00 AM every Tuesday
66

77
repository_dispatch:
88
types: ocwm-creator
@@ -35,6 +35,26 @@ jobs:
3535
date=$(date -u -d "6 days" +%Y-%m-%d)
3636
echo "title=Open Community Working Meeting ${date} - 12:00 PT" >> "$GITHUB_OUTPUT"
3737
38+
# Step to check if it's the third Tuesday of the month
39+
- name: Check if today is the third Tuesday
40+
id: check-third-tuesday
41+
run: |
42+
day=$(date +%d)
43+
dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday)
44+
# Get the first day of this month
45+
first_tuesday=$(cal | awk '/^..$/ {print $3}')
46+
if [ "$dow" -ne 2 ]; then
47+
echo "Not a Tuesday, exiting..."
48+
exit 0
49+
fi
50+
# Calculate the third Tuesday by checking if the current date is between 15th and 21st
51+
if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then
52+
echo "This is the third Tuesday of the month!"
53+
else
54+
echo "Not the third Tuesday, exiting..."
55+
exit 0
56+
fi
57+
3858
- name: Create Issue using Template
3959
id: create-issue
4060
uses: peter-evans/create-issue-from-file@v5

.github/workflows/ocwm-issue-collector.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Search for issues and PR labeled 'agenda' and add them to the agenda
22

33
on:
44
schedule:
5-
- cron: '0 0 8-14 * 0' # Runs at midnight on the second Sunday of the month
5+
- cron: '0 1 * * 1' # Runs at 1:00 AM every Monday
66

77
repository_dispatch:
88
types: add-issues-ocwm
@@ -26,6 +26,25 @@ jobs:
2626

2727
- name: Install dependencies
2828
run: npm install @octokit/core@5.1.0
29+
30+
# Step to check if today is the third Monday
31+
- name: Check if today is the third Monday
32+
id: check-third-monday
33+
run: |
34+
day=$(date +%d)
35+
dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday)
36+
# Check if the day is between 15th and 21st, and if it's Monday (1)
37+
if [ "$dow" -ne 1 ]; then
38+
echo "Not a Monday, exiting..."
39+
exit 0
40+
fi
41+
if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then
42+
echo "This is the third Monday of the month!"
43+
else
44+
echo "Not the third Monday, exiting..."
45+
exit 0
46+
fi
47+
2948
- name: Adding Issues
3049
id: add-issues
3150
uses: actions/github-script@v7

.github/workflows/ocwm-reminders.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ jobs:
2828
- name: Install dependencies
2929
run: npm install @octokit/core@5.1.0
3030

31+
# Step to check if today is the third Monday
32+
- name: Check if today is the third Monday
33+
id: check-third-monday
34+
run: |
35+
day=$(date +%d)
36+
dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday)
37+
# Check if the day is between 15th and 21st, and if it's Monday (1)
38+
if [ "$dow" -ne 1 ]; then
39+
echo "Not a Monday, exiting..."
40+
exit 0
41+
fi
42+
if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then
43+
echo "This is the third Monday of the month!"
44+
else
45+
echo "Not the third Monday, exiting..."
46+
exit 0
47+
fi
48+
3149
- name: Send reminders
3250
uses: actions/github-script@v7
3351
env:

0 commit comments

Comments
 (0)