-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.5 KB
/
notification.yaml
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
---
name: "PR Notification"
'on':
pull_request:
types: [opened, closed]
jobs:
irc-notification:
runs-on: ubuntu-latest
name: Notify on IRC
steps:
- name: irc notification
run: |
sudo apt-get update
sudo apt-get install netcat -y
message="${{ github.actor }} ${{ github.event.action }} ${{ github.event.pull_request._links.html.href }}"
echo -e "USER notefromgithub notefromgithub notefromgithub :notefromgithub\nNICK notefromgithub\nJOIN #wikimedia-cloud-feed\nPRIVMSG #wikimedia-cloud-feed :${message}\nQUIT\n" | nc irc.libera.chat 6667
phabricator-comment:
runs-on: ubuntu-latest
name: Comment on Phabricator
steps:
- uses: actions/checkout@v2
- name: post to phabricator
run: |
message="${{ github.actor }} ${{ github.event.action }} ${{ github.event.pull_request._links.html.href }}"
echo "${message}"
inital_commit=$(git log origin/main..origin/${{ github.head_ref }} --pretty=%H | tail -n1)
task=$(curl ${{ github.event.pull_request._links.commits.href }} | jq .[0].commit.message -r | grep "^Bug: T[0-9]*$" | head -1 | awk '{print $2}')
if [ -n "${task}" ]; then
curl https://phabricator.wikimedia.org/api/maniphest.edit \
-d api.token=${{ secrets.TOOLFORGE_PHAB_BOT_KEY }} \
-d transactions[0][type]=comment \
-d transactions[0][value]="${message}" \
-d objectIdentifier=${task}
fi