-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (76 loc) · 2.48 KB
/
action.yml
File metadata and controls
81 lines (76 loc) · 2.48 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
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
name: "reagento/relator"
description: "Send Telegram and Discord notifications for new GitHub issues or PRs"
author: "Sehat1137"
inputs:
tg-bot-token:
description: "Telegram Bot Token"
required: false
tg-chat-id:
description: "Telegram Chat ID"
required: false
tg-message-thread-id:
description: "Telegram Message Thread ID"
required: false
discord-webhook-url:
description: "Discord Webhook URL"
required: false
discord-thread-id:
description: "Discord thread ID to post in (optional)"
required: false
github-token:
description: "GitHub Token for API access"
required: false
base-url:
description: "Base URL for sulguk"
required: false
default: "https://github.com"
python-version:
description: "Python version for action"
required: false
default: "3.10"
attempt-count:
description: "Telegram API attempt count"
required: false
default: "2"
html-template:
description: "HTML template for Telegram message"
required: false
join-input-with-list:
description: "Join input with bulleted list for rendering like github"
required: true
default: "0"
custom-labels:
description: "Custom labels to add to every notification (comma-separated)"
required: false
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ inputs.python-version }}
- name: Install dependencies
shell: bash
run: |
pip install -r $GITHUB_ACTION_PATH/requirements.txt
- name: Send notifications
shell: bash
env:
TELEGRAM_BOT_TOKEN: ${{ inputs.tg-bot-token }}
TELEGRAM_CHAT_ID: ${{ inputs.tg-chat-id }}
TELEGRAM_MESSAGE_THREAD_ID: ${{ inputs.tg-message-thread-id }}
DISCORD_WEBHOOK_URL: ${{ inputs.discord-webhook-url }}
DISCORD_THREAD_ID: ${{ inputs.discord-thread-id }}
GITHUB_TOKEN: ${{ inputs.github-token }}
EVENT_URL: ${{ github.event.issue.url || github.event.pull_request.url }}
BASE_URL: ${{ inputs.base-url }}
ATTEMPT_COUNT: ${{ inputs.attempt-count }}
HTML_TEMPLATE: ${{ inputs.html-template }}
MD_TEMPLATE: ${{ inputs.md-template }}
JOIN_INPUT_WITH_LIST: ${{ inputs.join-input-with-list }}
CUSTOM_LABELS: ${{ inputs.custom-labels }}
run: |
cd $GITHUB_ACTION_PATH && python3 -m notifier
branding:
icon: "message-circle"
color: "blue"