-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add workflow for Agenda Verification and Notifications before Monday Meetings #802
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this PR! Much appreciated. I just added a few suggestions but looks great ...
REPO: 'community' | ||
OCWM_LABEL: ${{ vars.OCWM_LABEL }} | ||
TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }} |
This is the secret containing the the webhook
|
||
on: | ||
schedule: | ||
- cron: '50 21 * * 1' # Runs at 21:50 UTC, which is 10 minutes before 14:00 PT every Monday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 |
I am suggesting this change because we just decided to make the meetings mothly the 3rd monday of the month and 2 hours earlier as 12:00 PT
|
||
// 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!` |
Hi @benjagm, I've made the changes that were suggested to the workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nikhilkalburgi. I added some more suggestions mostly I found that making the process run only on the third monday of the month is not as easy as I thought and is not possible using only using cron. Please check the code and let me know.
|
||
on: | ||
schedule: | ||
- cron: '50 18 15-21 * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 21:50 UTC, which is 10 minutes before 14:00 PT every Monday |
My apologies but the code I suggested to be added was not working as I was expecting so sorry for suggesting it. Let's return your previous change.
Make the process runs only the third monday is not possible only using cron. We'll need to add a new step the workflow. I'll suggest the change later.
|
||
- name: Install Dependencies | ||
run: npm install @octokit/[email protected] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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 | |
This new step will make sure the process only runs completely the third monday of the month.
Hi @benjagm , I have added the new step to the workflow. I had to do tests to check if the last step is working. Anyway..Let me know if any other changes are required here. |
Can you rename this PR, please? 'Resolves an issue' doesn't tell me what this PR does. |
Renaming Done! |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge thanks for this contribution!! Let's merge it!
GitHub Issue: #794
Summary:
I have created a workflow that checks if the issue contains the original template every Monday 10min before the meeting. If there is any agenda added to it by the issue-collector workflow, then the condition does not match else a comment is sent to the issue thread along with slack notification like it is done for few other workflows.
This does not close the issue itself. Let me know if this works and you also want me to automate closing the issue.