diff --git a/.github/workflows/ocwm-creator.yml b/.github/workflows/ocwm-creator.yml index 76c23878..980a9e30 100644 --- a/.github/workflows/ocwm-creator.yml +++ b/.github/workflows/ocwm-creator.yml @@ -2,7 +2,7 @@ name: Create OCWM Monthly on: schedule: - - cron: "0 9 15-21 * 2" # Runs at 9:00 AM on the 3rd Tuesday of the month + - cron: "0 9 * * 2" # Runs at 9:00 AM every Tuesday repository_dispatch: types: ocwm-creator @@ -35,6 +35,26 @@ jobs: date=$(date -u -d "6 days" +%Y-%m-%d) echo "title=Open Community Working Meeting ${date} - 12:00 PT" >> "$GITHUB_OUTPUT" + # Step to check if it's the third Tuesday of the month + - name: Check if today is the third Tuesday + id: check-third-tuesday + run: | + day=$(date +%d) + dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday) + # Get the first day of this month + first_tuesday=$(cal | awk '/^..$/ {print $3}') + if [ "$dow" -ne 2 ]; then + echo "Not a Tuesday, exiting..." + exit 0 + fi + # Calculate the third Tuesday by checking if the current date is between 15th and 21st + if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then + echo "This is the third Tuesday of the month!" + else + echo "Not the third Tuesday, exiting..." + exit 0 + fi + - name: Create Issue using Template id: create-issue uses: peter-evans/create-issue-from-file@v5 diff --git a/.github/workflows/ocwm-issue-collector.yml b/.github/workflows/ocwm-issue-collector.yml index e9f36b0c..d88a7493 100644 --- a/.github/workflows/ocwm-issue-collector.yml +++ b/.github/workflows/ocwm-issue-collector.yml @@ -2,7 +2,7 @@ name: Search for issues and PR labeled 'agenda' and add them to the agenda on: schedule: - - cron: '0 0 8-14 * 0' # Runs at midnight on the second Sunday of the month + - cron: '0 1 * * 1' # Runs at 1:00 AM every Monday repository_dispatch: types: add-issues-ocwm @@ -26,6 +26,25 @@ jobs: - name: Install dependencies run: npm install @octokit/core@5.1.0 + + # Step to check if today is the third Monday + - name: Check if today is the third Monday + id: check-third-monday + run: | + day=$(date +%d) + dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday) + # Check if the day is between 15th and 21st, and if it's Monday (1) + if [ "$dow" -ne 1 ]; then + echo "Not a Monday, exiting..." + exit 0 + fi + if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then + echo "This is the third Monday of the month!" + else + echo "Not the third Monday, exiting..." + exit 0 + fi + - name: Adding Issues id: add-issues uses: actions/github-script@v7 diff --git a/.github/workflows/ocwm-reminders.yml b/.github/workflows/ocwm-reminders.yml index 84f9726f..ab5766d3 100644 --- a/.github/workflows/ocwm-reminders.yml +++ b/.github/workflows/ocwm-reminders.yml @@ -28,6 +28,24 @@ jobs: - name: Install dependencies run: npm install @octokit/core@5.1.0 + # Step to check if today is the third Monday + - name: Check if today is the third Monday + id: check-third-monday + run: | + day=$(date +%d) + dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday) + # Check if the day is between 15th and 21st, and if it's Monday (1) + if [ "$dow" -ne 1 ]; then + echo "Not a Monday, exiting..." + exit 0 + fi + if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then + echo "This is the third Monday of the month!" + else + echo "Not the third Monday, exiting..." + exit 0 + fi + - name: Send reminders uses: actions/github-script@v7 env: