-
Notifications
You must be signed in to change notification settings - Fork 863
ci: add Slack meeting reminder workflow for OPA Gatekeeper weekly meetings #4277
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
Changes from 4 commits
3a08078
7143546
e2661d2
e820b44
e604c1d
3f2c79d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| 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" | ||
| workflow_dispatch: | ||
| inputs: | ||
| force_run: | ||
| description: 'Force send notification (bypass week check)' | ||
| required: false | ||
| default: 'true' | ||
| type: boolean | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot remove this change to trigger workflow manully.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the |
||
|
|
||
| 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: | | ||
| # If manually triggered with force_run, skip the check | ||
| if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ inputs.force_run }}" == "true" ]; then | ||
| echo "Manual trigger with force_run enabled" | ||
| echo "should_run=true" >> $GITHUB_OUTPUT | ||
| exit 0 | ||
| fi | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot remove this change to trigger workflow manully.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the force_run check logic in e604c1d. |
||
|
|
||
| # 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 | ||
|
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' \ | ||
| --fail \ | ||
| --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
|
||
Uh oh!
There was an error while loading. Please reload this page.