-
-
Notifications
You must be signed in to change notification settings - Fork 41
30 lines (30 loc) · 975 Bytes
/
telegram-channel.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
name: send telegram channel message
on:
push:
paths: 'dist/easy-upload.user.js'
branches: [master]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install axios
- uses: actions/github-script@v6
with:
script: |
try {
const { default: createTgChannelMsg } = await import('${{ github.workspace }}/scripts/tg-channel.js');
await createTgChannelMsg(core)
const axios = require('axios')
const text = process.env.tgMsg
const response = await axios.post('https://api.telegram.org/bot${{secrets.TG_BOT_TOKEN}}/sendMessage', {
"chat_id": "-1001343736144",
text,
"parse_mode": "HTML"
})
}catch(error){
core.setFailed(error.message);
}