-
Notifications
You must be signed in to change notification settings - Fork 38
37 lines (33 loc) · 1.22 KB
/
issuetracker.yml
File metadata and controls
37 lines (33 loc) · 1.22 KB
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
name: issue-announce
on:
issues:
types: [opened]
permissions: {}
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Git Issue Details
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_CREATOR: ${{ github.event.issue.user.login }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
echo "Issue creator: $ISSUE_CREATOR"
echo "Issue title: $ISSUE_TITLE"
echo "Issue number: $ISSUE_NUMBER"
echo "Issue url: $ISSUE_URL"
- name: Google Chat Notification
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_CREATOR: ${{ github.event.issue.user.login }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
MESSAGE="[$ISSUE_NUMBER] $ISSUE_URL $ISSUE_TITLE ($ISSUE_CREATOR)"
JSON_PAYLOAD=$(jq -n --arg txt "$MESSAGE" '{text: $txt}')
curl --fail --location --request POST "$WEBHOOK_URL" \
--header 'Content-Type: application/json; charset=UTF-8' \
--data "$JSON_PAYLOAD"