-
Notifications
You must be signed in to change notification settings - Fork 549
54 lines (50 loc) · 2.19 KB
/
issue_opened.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Issue Opened
on:
issues:
types: [opened]
jobs:
notify:
runs-on: ubuntu-latest
permissions: {}
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
steps:
- name: Run webhook curl command
env:
WEBHOOK_URL: ${{ secrets.SLACK_ISSUE_WEBHOOK_URL }}
ISSUE: ${{toJson(github.event.issue.title)}}
ISSUE_URL: ${{github.event.issue.html_url}}
USER: ${{github.event.issue.user.login}}
shell: bash
run: echo $ISSUE | sed 's/[^a-zA-Z0-9 &().,:]//g' | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"issue":"{}", "issueUrl":"'$ISSUE_URL'", "user":"'$USER'"}'
add-issue-opened-labels:
runs-on: ubuntu-latest
permissions:
issues: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
steps:
- name: Add the pending-triage label
shell: bash
run: |
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-triage"
- name: Add the pending-maintainer-response label
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
shell: bash
run: |
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response"
maintainer-opened:
runs-on: ubuntu-latest
permissions:
issues: write
if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
steps:
- name: Post comment if maintainer opened.
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
run: |
gh issue comment $ISSUE_NUMBER --repo $REPOSITORY_NAME -b "This issue was opened by a maintainer of this repository; updates will be posted here. If you are also experiencing this issue, please comment here with any relevant information so that we're aware and can prioritize accordingly."