forked from edgardoh/darktable
-
-
Notifications
You must be signed in to change notification settings - Fork 23
117 lines (105 loc) · 4.47 KB
/
matrix.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Matrix bot
on:
push:
branches:
- master
pull_request_target:
types: [opened, edited, reopened, closed]
issues:
types: [opened, edited, milestoned, closed]
jobs:
matrix_action_job:
runs-on: ubuntu-latest
name: Send Message to Matrix Room
env:
REPO: "https://github.com/aurelienpierreeng/ansel"
ROOM: "!khBjOtEnQNuCYlWScJ:matrix.org"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install dependencies
run: |
python -m pip install simplematrixbotlib
- name: Dispatch message - new commit
if: github.event_name == 'push'
run: |
GIT_HASH=$(git rev-parse HEAD)
MESSAGE="Commit [$(git rev-parse --short HEAD)](${{ env.REPO }}/commit/${GIT_HASH}): $(git show -s --format=%s)"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - new issue
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
run: |
MESSAGE="New issue [${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) (_${{ github.event.issue.title }}_) created"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - issue edited
if: ${{ github.event_name == 'issues' && github.event.action == 'edited' }}
run: |
MESSAGE="Issue [${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) (_${{ github.event.issue.title }}_) edited"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - issue milestoned
if: ${{ github.event_name == 'issues' && github.event.action == 'milestoned' }}
run: |
MESSAGE="Issue [${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) (_${{ github.event.issue.title }}_) milestoned for ${{ github.event.issue.milestone.title }}"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - issue closed
if: ${{ github.event_name == 'issues' && github.event.action == 'closed' }}
run: |
MESSAGE="Issue [${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) (_${{ github.event.issue.title }}_) closed"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - new PR
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'opened' }}
run: |
MESSAGE="New PR [${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) (_${{ github.event.pull_request.title }}_) created"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - PR edited
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'edited' }}
run: |
MESSAGE="PR [${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) (_${{ github.event.pull_request.title }}_) edited"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}
- name: Dispatch message - PR closed
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'closed' }}
run: |
MESSAGE="PR [${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) (_${{ github.event.pull_request.title }}_) closed"
python .ci/matrix.py \
-m "$MESSAGE" \
-s ${{ secrets.MATRIX_SERVER }} \
-u ${{ secrets.MATRIX_USER }} \
-t ${{ secrets.MATRIX_ACCESS }} \
-r ${{ env.ROOM }}