From e0f077871cf7da6fd9629e5c6d6b056ac42b1e63 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 16 Sep 2024 18:27:21 +0530 Subject: [PATCH 01/20] Add ocwm-pre-meeting-check.yml to workflow --- .github/workflows/ocwm-pre-meeting-check.yml | 83 ++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/ocwm-pre-meeting-check.yml diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml new file mode 100644 index 00000000..5f201ad9 --- /dev/null +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -0,0 +1,83 @@ +name: OCWM Pre-Meeting Check + +on: + schedule: + - cron: '50 21 * * 1' # Runs at 21:50 UTC, which is 10 minutes before 14:00 PT every Monday + +jobs: + check_agenda: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Node 20 + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Get GitHub Token + uses: actions/create-github-app-token@v1 + id: get_workflow_token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Install Dependencies + run: npm install @octokit/core@5.1.0 + + - name: Check Latest OCWM Issue + id: check_issue + env: + MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + OWNER: ${{ vars.ORGANISATION }} + REPO: 'community' + OCWM_LABEL: ${{ vars.OCWM_LABEL }} + TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + run: | + const fs = require('fs'); + const octokit = require('@octokit/core').Octokit; + const mygithub = new octokit({ + request: { fetch: fetch, }, + auth: process.env.MY_TOKEN + }); + + // Read the template from the markdown file + const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); + + // Fetch the latest issue with OCWM_LABEL + const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); + + if (issues.length === 0) { + console.log("No open community working meeting issues found."); + return; + } + + const latestIssue = issues[0]; + const issueBody = latestIssue.body; + + // Check if the issue body matches the template + if (issueBody.includes(templateContent)) { + console.log("Template matched, cancelling the meeting."); + + // Add a comment to the issue + await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { + body: "The meeting has been cancelled as there is no agenda available." + }); + + // Send a notification to Slack + const slackPayload = { + text: `Meeting cancelled: No agenda found for the Open Community Working Meeting scheduled for today.` + }; + + await fetch(process.env.SLACK_WEBHOOK, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(slackPayload) + }); + + } else { + console.log("Agenda found. Meeting will proceed."); + } From 302a673828211140895fff2e4bbc02190d983411 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 16 Sep 2024 18:31:43 +0530 Subject: [PATCH 02/20] change ocwm-pre-meeting-check.yml comment --- .github/workflows/ocwm-pre-meeting-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 5f201ad9..25217500 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -64,12 +64,12 @@ jobs: // Add a comment to the issue await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { - body: "The meeting has been cancelled as there is no agenda available." + body: "The meeting as been cancelled as there is no agenda for today. Thanks" }); // Send a notification to Slack const slackPayload = { - text: `Meeting cancelled: No agenda found for the Open Community Working Meeting scheduled for today.` + text: `The meeting as been cancelled as there is no agenda for today. Thanks` }; await fetch(process.env.SLACK_WEBHOOK, { From f8948ce11e67d477fbaccd185ac775c15840edb5 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:45:26 +0530 Subject: [PATCH 03/20] fix: update ocwm-pre-meeting-check.yml with suggested changes --- .github/workflows/ocwm-pre-meeting-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 25217500..c05a1c0b 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -2,7 +2,7 @@ name: OCWM Pre-Meeting Check on: schedule: - - cron: '50 21 * * 1' # Runs at 21:50 UTC, which is 10 minutes before 14:00 PT every Monday + - cron: '50 18 15-21 * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month jobs: check_agenda: @@ -35,7 +35,7 @@ jobs: REPO: 'community' OCWM_LABEL: ${{ vars.OCWM_LABEL }} TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} run: | const fs = require('fs'); const octokit = require('@octokit/core').Octokit; @@ -64,12 +64,12 @@ jobs: // Add a comment to the issue await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { - body: "The meeting as been cancelled as there is no agenda for today. Thanks" + body: "The meeting has been cancelled as there is no agenda for today. Thanks everyone!" }); // Send a notification to Slack const slackPayload = { - text: `The meeting as been cancelled as there is no agenda for today. Thanks` + text: `The meeting has been cancelled as there is no agenda for today. Thanks everyone!` }; await fetch(process.env.SLACK_WEBHOOK, { From c295acf6ee8d4cb52dc12234f19ede1326ed98cb Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:31:49 +0530 Subject: [PATCH 04/20] update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index c05a1c0b..cb683dac 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -2,7 +2,8 @@ name: OCWM Pre-Meeting Check on: schedule: - - cron: '50 18 15-21 * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month + - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month + workflow_dispatch: jobs: check_agenda: @@ -27,8 +28,27 @@ jobs: - name: Install Dependencies run: npm install @octokit/core@5.1.0 + - 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!" + echo "third_monday=true" >> $GITHUB_ENV + else: + echo "Not the third Monday, exiting..." + exit 0 + fi + - name: Check Latest OCWM Issue id: check_issue + if: env.third_monday == 'true' env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} OWNER: ${{ vars.ORGANISATION }} From 50942a30b6ac90e7e223892be4a253624d5083b7 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:34:19 +0530 Subject: [PATCH 05/20] update ocwm-pre-meeting-check.yml for test --- .github/workflows/ocwm-pre-meeting-check.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index cb683dac..230d27eb 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -18,13 +18,6 @@ jobs: with: node-version: '20' - - name: Get GitHub Token - uses: actions/create-github-app-token@v1 - id: get_workflow_token - with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.PRIVATE_KEY }} - - name: Install Dependencies run: npm install @octokit/core@5.1.0 From 56383f9f8b98b38f8d69e5132c1b68dcfb8d918a Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:37:07 +0530 Subject: [PATCH 06/20] second update ocwm-pre-meeting-check.yml for test --- .github/workflows/ocwm-pre-meeting-check.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 230d27eb..8cad47bb 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -24,20 +24,7 @@ jobs: - 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!" - echo "third_monday=true" >> $GITHUB_ENV - else: - echo "Not the third Monday, exiting..." - exit 0 - fi + echo "third_monday=true" >> $GITHUB_ENV - name: Check Latest OCWM Issue id: check_issue From 4bd44dba27fb1fe7bc56ff1c99df102af23b8df2 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:44:16 +0530 Subject: [PATCH 07/20] third update ocwm-pre-meeting-check.yml for test --- .github/workflows/ocwm-pre-meeting-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 8cad47bb..438c81dc 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -28,7 +28,7 @@ jobs: - name: Check Latest OCWM Issue id: check_issue - if: env.third_monday == 'true' + if: ${{ env.third_monday == 'true' }} env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} OWNER: ${{ vars.ORGANISATION }} From 6fff2cacc3cbbb7d31538508b1f069f709453341 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:58:11 +0530 Subject: [PATCH 08/20] forth update ocwm-pre-meeting-check.yml for test --- .github/workflows/ocwm-pre-meeting-check.yml | 94 +++++++++++--------- 1 file changed, 50 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 438c81dc..6d4dd742 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -37,47 +37,53 @@ jobs: TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} run: | - const fs = require('fs'); - const octokit = require('@octokit/core').Octokit; - const mygithub = new octokit({ - request: { fetch: fetch, }, - auth: process.env.MY_TOKEN - }); - - // Read the template from the markdown file - const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); - - // Fetch the latest issue with OCWM_LABEL - const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); - - if (issues.length === 0) { - console.log("No open community working meeting issues found."); - return; - } - - const latestIssue = issues[0]; - const issueBody = latestIssue.body; - - // Check if the issue body matches the template - if (issueBody.includes(templateContent)) { - console.log("Template matched, cancelling the meeting."); - - // Add a comment to the issue - await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { - body: "The meeting has been cancelled as there is no agenda for today. Thanks everyone!" - }); - - // Send a notification to Slack - const slackPayload = { - text: `The meeting has been cancelled as there is no agenda for today. Thanks everyone!` - }; - - await fetch(process.env.SLACK_WEBHOOK, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(slackPayload) - }); - - } else { - console.log("Agenda found. Meeting will proceed."); - } + const fs = require('fs'); + const fetch = require('node-fetch'); + const { Octokit } = require('@octokit/core'); + + (async () => { + const mygithub = new Octokit({ + auth: process.env.MY_TOKEN, + request: { fetch: fetch } + }); + + // Read the template from the markdown file + const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); + + // Fetch the latest issue with OCWM_LABEL + const { data: issues } = await mygithub.request( + \`GET /repos/\${process.env.OWNER}/\${process.env.REPO}/issues?labels=\${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1\` + ); + + if (issues.length === 0) { + console.log('No open community working meeting issues found.'); + return; + } + + const latestIssue = issues[0]; + const issueBody = latestIssue.body; + + // Check if the issue body matches the template + if (issueBody.includes(templateContent)) { + console.log('Template matched, cancelling the meeting.'); + + // Add a comment to the issue + await mygithub.request( + \`POST /repos/\${process.env.OWNER}/\${process.env.REPO}/issues/\${latestIssue.number}/comments\`, + { body: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' } + ); + + // Send a notification to Slack + const slackPayload = { + text: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' + }; + + await fetch(process.env.SLACK_WEBHOOK, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(slackPayload) + }); + } else { + console.log('Agenda found. Meeting will proceed.'); + } + })(); From 9323d9316008ed7ab58ad589ac381781a8b06046 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:02:15 +0530 Subject: [PATCH 09/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 125 +++++++++++-------- 1 file changed, 73 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 6d4dd742..587415a0 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -3,7 +3,7 @@ name: OCWM Pre-Meeting Check on: schedule: - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month - workflow_dispatch: + workflow_dispatch: jobs: check_agenda: @@ -19,15 +19,34 @@ jobs: node-version: '20' - name: Install Dependencies - run: npm install @octokit/core@5.1.0 + run: npm install @octokit/core@5.1.0 node-fetch + + - name: Get GitHub Token + uses: actions/create-github-app-token@v1 + id: get_workflow_token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} - name: Check if today is the third Monday id: check-third-monday run: | - echo "third_monday=true" >> $GITHUB_ENV + 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!" + echo "third_monday=true" >> $GITHUB_ENV + else + echo "Not the third Monday, exiting..." + exit 0 + fi - name: Check Latest OCWM Issue - id: check_issue if: ${{ env.third_monday == 'true' }} env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} @@ -37,53 +56,55 @@ jobs: TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} run: | - const fs = require('fs'); - const fetch = require('node-fetch'); - const { Octokit } = require('@octokit/core'); - - (async () => { - const mygithub = new Octokit({ - auth: process.env.MY_TOKEN, - request: { fetch: fetch } - }); - - // Read the template from the markdown file - const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); - - // Fetch the latest issue with OCWM_LABEL - const { data: issues } = await mygithub.request( - \`GET /repos/\${process.env.OWNER}/\${process.env.REPO}/issues?labels=\${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1\` + node -e " + const fs = require('fs'); + const fetch = require('node-fetch'); + const { Octokit } = require('@octokit/core'); + + (async () => { + const mygithub = new Octokit({ + auth: process.env.MY_TOKEN, + request: { fetch: fetch } + }); + + // Read the template from the markdown file + const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); + + // Fetch the latest issue with OCWM_LABEL + const { data: issues } = await mygithub.request( + \`GET /repos/\${process.env.OWNER}/\${process.env.REPO}/issues?labels=\${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1\` + ); + + if (issues.length === 0) { + console.log('No open community working meeting issues found.'); + return; + } + + const latestIssue = issues[0]; + const issueBody = latestIssue.body; + + // Check if the issue body matches the template + if (issueBody.includes(templateContent)) { + console.log('Template matched, cancelling the meeting.'); + + // Add a comment to the issue + await mygithub.request( + \`POST /repos/\${process.env.OWNER}/\${process.env.REPO}/issues/\${latestIssue.number}/comments\`, + { body: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' } ); - if (issues.length === 0) { - console.log('No open community working meeting issues found.'); - return; - } - - const latestIssue = issues[0]; - const issueBody = latestIssue.body; - - // Check if the issue body matches the template - if (issueBody.includes(templateContent)) { - console.log('Template matched, cancelling the meeting.'); - - // Add a comment to the issue - await mygithub.request( - \`POST /repos/\${process.env.OWNER}/\${process.env.REPO}/issues/\${latestIssue.number}/comments\`, - { body: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' } - ); - - // Send a notification to Slack - const slackPayload = { - text: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' - }; - - await fetch(process.env.SLACK_WEBHOOK, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(slackPayload) - }); - } else { - console.log('Agenda found. Meeting will proceed.'); - } - })(); + // Send a notification to Slack + const slackPayload = { + text: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' + }; + + await fetch(process.env.SLACK_WEBHOOK, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(slackPayload) + }); + } else { + console.log('Agenda found. Meeting will proceed.'); + } + })(); + " From 05f72a1c3258b84061dbf9eea2898f36f24878c4 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:04:36 +0530 Subject: [PATCH 10/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 587415a0..5112450c 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -21,30 +21,10 @@ jobs: - name: Install Dependencies run: npm install @octokit/core@5.1.0 node-fetch - - name: Get GitHub Token - uses: actions/create-github-app-token@v1 - id: get_workflow_token - with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.PRIVATE_KEY }} - - 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!" echo "third_monday=true" >> $GITHUB_ENV - else - echo "Not the third Monday, exiting..." - exit 0 - fi - name: Check Latest OCWM Issue if: ${{ env.third_monday == 'true' }} From 638acae08bcd8fb2064ff458e38c0af42bd6b652 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:07:39 +0530 Subject: [PATCH 11/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 62 +++++--------------- 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 5112450c..ef86c44f 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -36,55 +36,23 @@ jobs: TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} run: | - node -e " const fs = require('fs'); - const fetch = require('node-fetch'); - const { Octokit } = require('@octokit/core'); + const octokit = require('@octokit/core').Octokit; + const mygithub = new octokit({ + request: { fetch: fetch, }, + auth: process.env.MY_TOKEN + }); - (async () => { - const mygithub = new Octokit({ - auth: process.env.MY_TOKEN, - request: { fetch: fetch } - }); + // Read the template from the markdown file + const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); - // Read the template from the markdown file - const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); + // Fetch the latest issue with OCWM_LABEL + const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); - // Fetch the latest issue with OCWM_LABEL - const { data: issues } = await mygithub.request( - \`GET /repos/\${process.env.OWNER}/\${process.env.REPO}/issues?labels=\${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1\` - ); + if (issues.length === 0) { + console.log("No open community working meeting issues found."); + return; + } - if (issues.length === 0) { - console.log('No open community working meeting issues found.'); - return; - } - - const latestIssue = issues[0]; - const issueBody = latestIssue.body; - - // Check if the issue body matches the template - if (issueBody.includes(templateContent)) { - console.log('Template matched, cancelling the meeting.'); - - // Add a comment to the issue - await mygithub.request( - \`POST /repos/\${process.env.OWNER}/\${process.env.REPO}/issues/\${latestIssue.number}/comments\`, - { body: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' } - ); - - // Send a notification to Slack - const slackPayload = { - text: 'The meeting has been cancelled as there is no agenda for today. Thanks everyone!' - }; - - await fetch(process.env.SLACK_WEBHOOK, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(slackPayload) - }); - } else { - console.log('Agenda found. Meeting will proceed.'); - } - })(); - " + const latestIssue = issues[0]; + const issueBody = latestIssue.body; From e6928b3e3f6cfd6055e9b7ad9436602be006e14c Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:10:02 +0530 Subject: [PATCH 12/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index ef86c44f..81975fb0 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -21,13 +21,7 @@ jobs: - name: Install Dependencies run: npm install @octokit/core@5.1.0 node-fetch - - name: Check if today is the third Monday - id: check-third-monday - run: | - echo "third_monday=true" >> $GITHUB_ENV - - name: Check Latest OCWM Issue - if: ${{ env.third_monday == 'true' }} env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} OWNER: ${{ vars.ORGANISATION }} From 495c6f90e6b6b3c11f6148fd65806de793a025c2 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:14:09 +0530 Subject: [PATCH 13/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 84 ++++++++++++++------ 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 81975fb0..490318f4 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -3,7 +3,6 @@ name: OCWM Pre-Meeting Check on: schedule: - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month - workflow_dispatch: jobs: check_agenda: @@ -18,10 +17,24 @@ jobs: with: node-version: '20' + - name: Get GitHub Token + uses: actions/create-github-app-token@v1 + id: get_workflow_token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + - name: Install Dependencies - run: npm install @octokit/core@5.1.0 node-fetch + run: npm install @octokit/core@5.1.0 + + - name: Check if today is the third Monday + id: check-third-monday + run: | + echo "third_monday=true" >> $GITHUB_ENV - name: Check Latest OCWM Issue + id: check_issue + if: env.third_monday == 'true' env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} OWNER: ${{ vars.ORGANISATION }} @@ -29,24 +42,49 @@ jobs: OCWM_LABEL: ${{ vars.OCWM_LABEL }} TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} - run: | - const fs = require('fs'); - const octokit = require('@octokit/core').Octokit; - const mygithub = new octokit({ - request: { fetch: fetch, }, - auth: process.env.MY_TOKEN - }); - - // Read the template from the markdown file - const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); - - // Fetch the latest issue with OCWM_LABEL - const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); - - if (issues.length === 0) { - console.log("No open community working meeting issues found."); - return; - } - - const latestIssue = issues[0]; - const issueBody = latestIssue.body; + with: + script: | + const fs = require('fs'); + const octokit = require('@octokit/core').Octokit; + const mygithub = new octokit({ + request: { fetch: fetch, }, + auth: process.env.MY_TOKEN + }); + + // Read the template from the markdown file + const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); + + // Fetch the latest issue with OCWM_LABEL + const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); + + if (issues.length === 0) { + console.log("No open community working meeting issues found."); + return; + } + + const latestIssue = issues[0]; + const issueBody = latestIssue.body; + + // Check if the issue body matches the template + if (issueBody.includes(templateContent)) { + console.log("Template matched, cancelling the meeting."); + + // Add a comment to the issue + await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { + body: "The meeting has been cancelled as there is no agenda for today. Thanks everyone!" + }); + + // Send a notification to Slack + const slackPayload = { + text: `The meeting has been cancelled as there is no agenda for today. Thanks everyone!` + }; + + await fetch(process.env.SLACK_WEBHOOK, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(slackPayload) + }); + + } else { + console.log("Agenda found. Meeting will proceed."); + } From e091bae9b721bda0077577fb7d41b52a416cbffe Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:14:59 +0530 Subject: [PATCH 14/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 490318f4..1caffab4 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -3,6 +3,7 @@ name: OCWM Pre-Meeting Check on: schedule: - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month + workflow_dispatch: jobs: check_agenda: From 6299e1a6069ed4889676c05aafdeb2ce0bf3eda2 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:19:40 +0530 Subject: [PATCH 15/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 102 +++++++++++++++++-- 1 file changed, 94 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 1caffab4..12d4a1b0 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -3,7 +3,7 @@ name: OCWM Pre-Meeting Check on: schedule: - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month - workflow_dispatch: + workflow_dispatch: jobs: check_agenda: @@ -18,12 +18,86 @@ jobs: with: node-version: '20' - - name: Get GitHub Token - uses: actions/create-github-app-token@v1 - id: get_workflow_token + - name: Install Dependencies + run: npm install @octokit/core@5.1.0 + + - name: Check if today is the third Monday + id: check-third-monday + run: | + echo "third_monday=true" >> $GITHUB_ENV + + - name: Check Latest OCWM Issue + id: check_issue + if: ${{ env.third_monday == 'true' }} + env: + MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + OWNER: ${{ vars.ORGANISATION }} + REPO: 'community' + OCWM_LABEL: ${{ vars.OCWM_LABEL }} + TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} + run: | + const fs = require('fs'); + const octokit = require('@octokit/core').Octokit; + const mygithub = new octokit({ + request: { fetch: fetch, }, + auth: process.env.MY_TOKEN + }); + + // Read the template from the markdown file + const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); + + // Fetch the latest issue with OCWM_LABEL + const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); + + if (issues.length === 0) { + console.log("No open community working meeting issues found."); + return; + } + + const latestIssue = issues[0]; + const issueBody = latestIssue.body; + + // Check if the issue body matches the template + if (issueBody.includes(templateContent)) { + console.log("Template matched, cancelling the meeting."); + + // Add a comment to the issue + await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { + body: "The meeting has been cancelled as there is no agenda for today. Thanks everyone!" + }); + + // Send a notification to Slack + const slackPayload = { + text: `The meeting has been cancelled as there is no agenda for today. Thanks everyone!` + }; + + await fetch(process.env.SLACK_WEBHOOK, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(slackPayload) + }); + + } else { + console.log("Agenda found. Meeting will proceed."); + }name: OCWM Pre-Meeting Check + +on: + schedule: + - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month + +jobs: + check_agenda: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Node 20 + uses: actions/setup-node@v4 with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.PRIVATE_KEY }} + node-version: '20' - name: Install Dependencies run: npm install @octokit/core@5.1.0 @@ -31,11 +105,23 @@ jobs: - name: Check if today is the third Monday id: check-third-monday run: | - echo "third_monday=true" >> $GITHUB_ENV + 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: Check Latest OCWM Issue id: check_issue - if: env.third_monday == 'true' + uses: actions/github-script@v7 env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} OWNER: ${{ vars.ORGANISATION }} From ef9ffbe35483d6c8e6600207fa1b98ee786348aa Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:22:25 +0530 Subject: [PATCH 16/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 98 -------------------- 1 file changed, 98 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 12d4a1b0..44899f64 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -21,104 +21,6 @@ jobs: - name: Install Dependencies run: npm install @octokit/core@5.1.0 - - name: Check if today is the third Monday - id: check-third-monday - run: | - echo "third_monday=true" >> $GITHUB_ENV - - - name: Check Latest OCWM Issue - id: check_issue - if: ${{ env.third_monday == 'true' }} - env: - MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }} - OWNER: ${{ vars.ORGANISATION }} - REPO: 'community' - OCWM_LABEL: ${{ vars.OCWM_LABEL }} - TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} - run: | - const fs = require('fs'); - const octokit = require('@octokit/core').Octokit; - const mygithub = new octokit({ - request: { fetch: fetch, }, - auth: process.env.MY_TOKEN - }); - - // Read the template from the markdown file - const templateContent = fs.readFileSync(process.env.TEMPLATE_PATH, 'utf8'); - - // Fetch the latest issue with OCWM_LABEL - const { data: issues } = await mygithub.request(`GET /repos/${process.env.OWNER}/${process.env.REPO}/issues?labels=${encodeURIComponent(process.env.OCWM_LABEL)}&per_page=1`); - - if (issues.length === 0) { - console.log("No open community working meeting issues found."); - return; - } - - const latestIssue = issues[0]; - const issueBody = latestIssue.body; - - // Check if the issue body matches the template - if (issueBody.includes(templateContent)) { - console.log("Template matched, cancelling the meeting."); - - // Add a comment to the issue - await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, { - body: "The meeting has been cancelled as there is no agenda for today. Thanks everyone!" - }); - - // Send a notification to Slack - const slackPayload = { - text: `The meeting has been cancelled as there is no agenda for today. Thanks everyone!` - }; - - await fetch(process.env.SLACK_WEBHOOK, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(slackPayload) - }); - - } else { - console.log("Agenda found. Meeting will proceed."); - }name: OCWM Pre-Meeting Check - -on: - schedule: - - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month - -jobs: - check_agenda: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Node 20 - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install Dependencies - run: npm install @octokit/core@5.1.0 - - - 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: Check Latest OCWM Issue id: check_issue uses: actions/github-script@v7 From 86bf4213635613f239be0a6d96ae8ecd417b3564 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:25:42 +0530 Subject: [PATCH 17/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 44899f64..15546874 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -29,7 +29,7 @@ jobs: OWNER: ${{ vars.ORGANISATION }} REPO: 'community' OCWM_LABEL: ${{ vars.OCWM_LABEL }} - TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' + TEMPLATE_PATH: '.github/ISSUE_TEMPLATE/open_community_working_meeting.md' SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} with: script: | From d568f579db088e5803223e460b7074a15e758e82 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:29:50 +0530 Subject: [PATCH 18/20] Update ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 15546874..d891f7c3 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -18,6 +18,30 @@ jobs: with: node-version: '20' + - name: Get GitHub Token + uses: actions/create-github-app-token@v1 + id: get_workflow_token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + + - 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: Install Dependencies run: npm install @octokit/core@5.1.0 From 7e93929fb3c31a58338859141eeea0d3b7f065d7 Mon Sep 17 00:00:00 2001 From: Nikhil S Kalburgi <70331875+nikhilkalburgi@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:32:24 +0530 Subject: [PATCH 19/20] fix: improve ocwm-pre-meeting-check.yml --- .github/workflows/ocwm-pre-meeting-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index d891f7c3..2cc6cf86 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -2,8 +2,7 @@ name: OCWM Pre-Meeting Check on: schedule: - - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month - workflow_dispatch: + - cron: '50 21 * * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month jobs: check_agenda: @@ -24,6 +23,9 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Install Dependencies + run: npm install @octokit/core@5.1.0 - name: Check if today is the third Monday id: check-third-monday @@ -42,8 +44,6 @@ jobs: exit 0 fi - - name: Install Dependencies - run: npm install @octokit/core@5.1.0 - name: Check Latest OCWM Issue id: check_issue From 93cc7e1e59d348dbcded8763a35fa8e9dde20164 Mon Sep 17 00:00:00 2001 From: Benjamin Granados <40007659+benjagm@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:30:33 +0200 Subject: [PATCH 20/20] Update ocwm-pre-meeting-check.yml We are facing issues with this same logic in other workflows. I am just applying the same version we have in other workflows to consistently merge with master branch. --- .github/workflows/ocwm-pre-meeting-check.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ocwm-pre-meeting-check.yml b/.github/workflows/ocwm-pre-meeting-check.yml index 2cc6cf86..cf83898f 100644 --- a/.github/workflows/ocwm-pre-meeting-check.yml +++ b/.github/workflows/ocwm-pre-meeting-check.yml @@ -27,6 +27,7 @@ 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: | @@ -35,18 +36,21 @@ jobs: # 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..." + echo "::set-output name=is-third-monday::false" exit 0 fi if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then echo "This is the third Monday of the month!" + echo "::set-output name=is-third-monday::true" else echo "Not the third Monday, exiting..." + echo "::set-output name=is-third-monday::false" exit 0 - fi - + fi - name: Check Latest OCWM Issue id: check_issue + if: steps.check-third-monday.outputs.is-third-monday == 'true' uses: actions/github-script@v7 env: MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }}