-
Notifications
You must be signed in to change notification settings - Fork 23
35 lines (32 loc) · 1.37 KB
/
issue_comment.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
name: Issue Comment
on:
issue_comment:
types: [created]
jobs:
notify:
runs-on: ubuntu-latest
permissions: {}
if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
steps:
- name: Run webhook curl command
env:
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
COMMENT: ${{toJson(github.event.comment.body)}}
USER: ${{github.event.comment.user.login}}
COMMENT_URL: ${{github.event.comment.html_url}}
shell: bash
run: echo $COMMENT | sed "s/\\\n/. /g; s/\\\r//g; s/[^a-zA-Z0-9 &().,:]//g" | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"comment":"{}", "commentUrl":"'$COMMENT_URL'", "user":"'$USER'"}'
remove-pending-response-label:
runs-on: ubuntu-latest
permissions:
issues: write
if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'pending-response') }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: remove unnecessary labels after comment
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
gh issue edit $ISSUE_NUMBER --remove-label "pending-response"