-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
92 lines (86 loc) · 3.98 KB
/
action.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
# Note: This is a composite GitHub Actions, it should do all env setup, caching an so on, so other pipelines can just compose their own stuff on top of that.
# Docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
name: "Storm Software - Notification"
description: "A composite action configuration used across many Storm Software repos to setup: checkout, Node.js, a package manager, and npm registry configuration."
author: "sullivanpj"
branding:
icon: "speaker"
color: "gray-dark"
inputs:
title:
description: Text to display in the notification
required: true
subtitle:
description: Subtitle to display in the notification
required: true
description:
description: Description to display in the notification
required: false
color:
description: Color of the displayed notification
required: true
default: "2077350"
status:
description: Status to display in the notification
required: true
default: "In Progress"
slack-token:
description: The Slack token used by the bot
required: true
telegram-token:
description: The Telegram token used by the bot
required: true
telegram-chat:
description: The Telegram chat used by the bot
required: true
discord-webhook:
description: The github username of the Storm bot
required: true
storm-bot:
description: The github username of the Storm bot
required: false
default: "Stormie-Bot"
runs:
using: "composite"
steps:
- name: Send Slack notification
uses: slackapi/[email protected]
with:
channel-id: "notifications"
payload: |
{
"text": "${{ inputs.title }}",
"attachments": [
{
"pretext": "${{ inputs.subtitle }}",
"color": "${{ inputs.color }}",
"fields": [
{
"title": "Status",
"short": true,
"value": "${{ inputs.status }}"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ inputs.slack-token }}
- name: Send Discord notification
uses: Ilshidur/action-discord@master
with:
args: ${{ inputs.title }}
env:
DISCORD_WEBHOOK: ${{ inputs.discord-webhook }}
DISCORD_USERNAME: ${{ inputs.storm-bot }}
DISCORD_AVATAR: "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-stormie.png"
DISCORD_EMBEDS: '[{ "author": { "name": "${{ github.actor }}", "url": "https://github.com/${{ github.actor }}", "icon_url": "https://avatars.githubusercontent.com/u/${{ github.actor_id }}?v=4" }, "title": "${{ inputs.subtitle }}", "description": "${{ inputs.description }}", "thumbnail": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" }, "fields": [ { "name": "Repository", "value": "${{ github.repository }}" }, { "name": "Runner", "value": "${{ runner.name }} - ${{ runner.os }} (${{ runner.arch }})" }, { "name": "Workflow Name", "value": "${{ github.workflow }}", "inline": true }, { "name": "Workflow Status", "value": "${{ inputs.status }}", "inline": true }], "image": { "url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-fill.png" }, "color": ${{ inputs.color }}, "timestamp": "${{ github.event.repository.updated_at }}", "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_number }}", "footer": { "text": "Click here to see the full workflow run details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_number }}", "icon_url": "https://pub-761b436209f44a4d886487c917806c08.r2.dev/icon-fill.png" } }]'
- name: Send Telegram notification
uses: storm-software/action-telegram-notify@main
with:
status: ${{ inputs.status }}
token: ${{ inputs.telegram-token }}
chat: ${{ inputs.telegram-chat }}
env:
TELEGRAM_TOKEN: ${{ inputs.telegram-token }}
TELEGRAM_CHAT: ${{ inputs.telegram-chat }}