Skip to content

Commit ca93476

Browse files
authored
chore(): Added dev ops webhooks (#6171)
1 parent 2c67a89 commit ca93476

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/issue_comment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ on:
55
types: [created]
66

77
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
permissions: {}
11+
if: ${{ !github.event.issue.pull_request }}
12+
steps:
13+
- name: Run webhook curl command
14+
env:
15+
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
16+
BODY: ${{ toJson(github.event.comment.body) }}
17+
COMMENT_URL: ${{ github.event.comment.html_url }}
18+
USER: ${{ github.event.comment.user.login }}
19+
shell: bash
20+
run: echo $BODY | 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 '{"body":"{}", "issue":"'$COMMENT_URL'", "user":"'$USER'"}'
21+
822
adjust-labels:
923
runs-on: ubuntu-latest
1024
permissions:

.github/workflows/issue_opened.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ on:
44
types: [opened]
55

66
jobs:
7+
notify:
8+
runs-on: ubuntu-latest
9+
permissions: {}
10+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
11+
steps:
12+
- name: Run webhook curl command
13+
env:
14+
WEBHOOK_URL: ${{ secrets.SLACK_ISSUE_WEBHOOK_URL }}
15+
ISSUE: ${{toJson(github.event.issue.title)}}
16+
ISSUE_URL: ${{github.event.issue.html_url}}
17+
USER: ${{github.event.issue.user.login}}
18+
shell: bash
19+
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'"}'
20+
721
add-issue-opened-labels:
822
runs-on: ubuntu-latest
923
permissions:

0 commit comments

Comments
 (0)