Skip to content

chore(release): 6.0.5 #86

chore(release): 6.0.5

chore(release): 6.0.5 #86

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
- uses: actions/github-script@v6
with:
script: |
try {
const { default: createTgChannelMsg } = await import('${{ github.workspace }}/scripts/tg-channel.js');
await createTgChannelMsg(core)
const text = process.env.tgMsg
const response = await fetch('https://api.telegram.org/bot${{secrets.TG_BOT_TOKEN}}/sendMessage',{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"chat_id": "-1001343736144",
text,
"parse_mode": "HTML"
})
})
const result = await response.json();
if(!response.ok){
core.setFailed(result.description);
}
}catch(error){
core.setFailed(error.message);
}