Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/slack-meeting-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Slack Meeting Reminder

on:
schedule:
# Run every Wednesday at 9 AM PST (5 PM UTC) - 1 hour before 10 AM meeting
- cron: "0 17 * * 3"
# Run every Wednesday at 1 PM PST (9 PM UTC) - 1 hour before 2 PM meeting
- cron: "0 21 * * 3"
Comment thread
JaydipGabani marked this conversation as resolved.

permissions: read-all

jobs:
send-reminder:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit

- name: Determine which time slot to use
id: check-week
run: |
# Get the ISO week number
WEEK_NUM=$(date +%V)
# Check if it's an even or odd week
if [ $((WEEK_NUM % 2)) -eq 0 ]; then
# Even week: 1 PM PST (21:00 UTC)
EXPECTED_HOUR=21
else
# Odd week: 9 AM PST (17:00 UTC)
EXPECTED_HOUR=17
fi
CURRENT_HOUR=$(date -u +%H)
echo "Expected hour: $EXPECTED_HOUR, Current hour: $CURRENT_HOUR"
if [ "$CURRENT_HOUR" -eq "$EXPECTED_HOUR" ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
Comment thread
JaydipGabani marked this conversation as resolved.

- name: Send Slack notification
if: steps.check-week.outputs.should_run == 'true'
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "The OPA Gatekeeper weekly is starting in 1 hour! :clock1:\n\nAdd your agenda items to the meeting notes to get your questions answered by one of the Gatekeeper maintainers.\n\n<https://docs.google.com/document/d/1A1-Q-1OMw3QODs1wT6eqfLTagcGmgzAJAjJihiO3T48/edit|Meeting Notes>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Starting time is every Wednesday alternating between:*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "• 10:00 and 14:00 Pacific Time"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "• 21:00 and 05:00 Central European Time"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<https://zoom.us/j/332405601|Join Meeting> :point_left:"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Check out previous meetings on <https://www.youtube.com/@openpolicyagent8458|YouTube>"
}
]
}
]
}' \
${{ secrets.SLACK_WEBHOOK_URL }}
Comment on lines +45 to +95
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curl command lacks error handling and will silently fail if the Slack webhook call fails. Add the --fail flag to make curl return a non-zero exit code on HTTP errors:

curl -X POST -H 'Content-type: application/json' \
  --fail \
  --data '{
    ...
  }' \
  ${{ secrets.SLACK_WEBHOOK_URL }}

This ensures the workflow step fails if the Slack notification cannot be sent.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you fix this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the --fail flag to the curl command in e820b44. Also added the workflow_dispatch trigger with force_run input and updated the week check logic to bypass the schedule check when manually triggered.

Loading