-
Notifications
You must be signed in to change notification settings - Fork 31
43 lines (34 loc) · 1.78 KB
/
project_notify.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
name: Project Automation - notify
on:
schedule:
- cron: '0 8 * * 1-5'
jobs:
Notify:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Send slack message for triage issues
env:
TRIAGE_URL: https://github.com/Royal-Navy/design-system/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Awaiting+triage%22
run: |
result=$(( gh issue list --repo Royal-Navy/design-system -l 'Status: Awaiting triage' ) 2>&1)
slack_triage () {
curl -X POST -H 'Content-type: application/json' --data '{"text":"There are <'$TRIAGE_URL'|Triage issues> to review this morning"}' ${{ secrets.SLACK_WEBHOOK }}
}
slack_notriage () {
curl -X POST -H 'Content-type: application/json' --data '{"text":"There are no issues to Triage this morning"}' ${{ secrets.SLACK_WEBHOOK }}
}
if [[ `echo $result` == *"Awaiting triage"* ]]; then slack_triage ; else slack_notriage; fi
- name: Send slack message for stale issues
env:
STALE_URL: https://github.com/Royal-Navy/design-system/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Stale%22
run: |
result=$(( gh issue list --repo Royal-Navy/design-system -l 'Status: Stale' ) 2>&1)
slack_stale () {
curl -X POST -H 'Content-type: application/json' --data '{"text":"There are <'$STALE_URL'|Stale issues> to review this morning"}' ${{ secrets.SLACK_WEBHOOK }}
}
slack_nostale () {
curl -X POST -H 'Content-type: application/json' --data '{"text":"There are no Stale issues to review this morning"}' ${{ secrets.SLACK_WEBHOOK }}
}
if [[ `echo $result` == *"Status: Stale"* ]]; then slack_stale ; else slack_nostale; fi