Skip to content

Commit

Permalink
[GitHub] Fix PR messages not properly sent (sofa-framework#4475)
Browse files Browse the repository at this point in the history
* Fix timing for messages

* Make the DISCORD_WEBHOOK_URL a global env var to job
  • Loading branch information
hugtalbot authored Jan 31, 2024
1 parent ea210dc commit 5acdacd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/post-agenda-sofa-dev-meeting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Post - SOFA dev meeting agenda/reminder

on:
schedule:
- cron: '30 7 * * 1' # 9:30 am CET every Monday
- cron: '0 6 * * 3' # 8:00 am CET on Wednesdays
- cron: '30 8 * * 1' # 9:30 am CET every Monday
- cron: '30 7 * * 3' # 8:00 am CET on Wednesdays

jobs:
run:
Expand All @@ -23,7 +23,7 @@ jobs:

# Monday message : agenda
- name: Run script post-discord-message.py
if: github.event.schedule == '30 7 * * 1'
if: github.event.schedule == '30 8 * * 1'
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
Expand All @@ -37,7 +37,7 @@ jobs:

# Wednesday message : get ready
- name: Run script post-discord-message.py
if: github.event.schedule == '0 6 * * 3'
if: github.event.schedule == '30 7 * * 3'
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/post-github-activity-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
run:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'sofa-framework' }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}

steps:
- name: Check out code
Expand All @@ -24,13 +26,12 @@ jobs:
working-directory: ${{ github.workspace }}

# PR opened
- name: Run script post-discord-message.py for PR opened (main)
- name: Run script post-discord-message.py for PR opened
if: ${{ github.event.action == 'opened' }}
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}
MESSAGE: ":new: PR opened: [#${{github.event.pull_request.number}} ${{github.event.pull_request.title}}](https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}})"
BOT_NAME: "SOFA Github bot"
EMBEDS_TITLE: "#${{github.event.pull_request.number}} ${{github.event.pull_request.title}}"
Expand All @@ -44,7 +45,6 @@ jobs:
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}
MESSAGE: ":raised_hands: Thanks [@${{github.event.pull_request.merged_by.login}}](https://github.com/${{github.event.pull_request.merged_by.login}}) for merging PR [#${{github.event.pull_request.number}} ${{github.event.pull_request.title}}](https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}}) authored by @${{github.event.pull_request.user.login}}"
BOT_NAME: "SOFA Github bot"
EMBEDS_TITLE: ""
Expand All @@ -58,7 +58,6 @@ jobs:
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}
MESSAGE: ":eyeglasses: Review requested: join(github.event.pull_request.requested_reviewers.*.login, ', ') would you please review [#${{github.event.pull_request.number}}](https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}})?"
BOT_NAME: "SOFA Github bot"
EMBEDS_TITLE: ""
Expand Down

0 comments on commit 5acdacd

Please sign in to comment.