-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (32 loc) · 1.14 KB
/
auto-cc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: "Auto Notify"
on:
issues:
types: [labeled]
pull_request_target:
types: [labeled]
jobs:
auto-notify:
if: |
github.repository_owner == 'cupy' &&
contains('|hip|array-api|', github.event.label.name)
env:
NOTIFY_TARGETS: '{"hip": "@amathews-amd", "array-api": "@asmeurer @leofang"}'
ISSUE_NUMBER: ${{ (github.event_name == 'issues' && github.event.issue.number) || github.event.pull_request.number }}
ISSUE_BODY_TAG: "<!-- Added by Auto Notify Bot (${{ github.event.label.name }}) -->"
runs-on: ubuntu-22.04
steps:
- name: Find comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ env.ISSUE_NUMBER }}
body-includes: ${{ env.ISSUE_BODY_TAG }}
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ env.ISSUE_NUMBER }}
comment-id: ${{steps.fc.outputs.comment-id}}
edit-mode: replace
body: |
${{ env.ISSUE_BODY_TAG }}
cc/ ${{ fromJSON(env.NOTIFY_TARGETS)[github.event.label.name] }}