mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 16:30:31 +02:00
Allow notification of two reviewers being assigned to a PR and two issue assignees (#10345)
Fixes https://github.com/certbot/certbot/issues/10344 You can see this working in the mattermost "Test" channel, where I ran this code from my test repo. The documentation for the PR reviewer syntax is here: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=review_requested#pull_request We now no longer notify on PR assignees. But I think that is the correct behavior. This PR also fixes a bug in the issue assigned notification code, and now lets you see when two different people were assigned. That documentation is here: https://docs.github.com/en/webhooks/webhook-events-and-payloads# After this is in, I'll make the same changes to the josepy repo. You can see the `if` syntax here: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows ``` on: pull_request: types: [review_requested] jobs: specific_review_requested: runs-on: ubuntu-latest if: ${{ github.event.requested_team.name == 'octo-team'}} steps: - run: echo 'A review from octo-team was requested' ``` --------- Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
This commit is contained in:
co-authored by
Brad Warren
parent
bc0b54950a
commit
6ee19bac55
@@ -3,9 +3,6 @@ name: Issue Assigned
|
||||
on:
|
||||
issues:
|
||||
types: [assigned]
|
||||
|
||||
pull_request_target:
|
||||
types: [assigned]
|
||||
jobs:
|
||||
send-mattermost-message:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -14,4 +11,4 @@ jobs:
|
||||
with:
|
||||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_ASSIGN_WEBHOOK }}
|
||||
TEXT: >
|
||||
${{ github.event.issue.assignee.login || github.event.pull_request.assignee.login }} assigned to "${{ github.event.issue.title || github.event.pull_request.title }}": ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
|
||||
${{ github.event.assignee.login }} assigned to "${{ github.event.issue.title }}": ${{ github.event.issue.html_url }}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
name: Review Requested
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [review_requested]
|
||||
jobs:
|
||||
send-mattermost-message:
|
||||
# Don't notify for the interim step of certbot/eff-devs being assigned
|
||||
if: ${{ github.event.requested_reviewer.login != ''}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: mattermost/action-mattermost-notify@master
|
||||
with:
|
||||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_ASSIGN_WEBHOOK }}
|
||||
TEXT: >
|
||||
Review requested from ${{ github.event.requested_reviewer.login }} for "${{ github.event.pull_request.title }}": ${{ github.event.pull_request.html_url }}
|
||||
Reference in New Issue
Block a user