Skip to content

test: workflow

test: workflow #80

name: send telegram channel message
on:
push:
paths: '.github/**'
branches: [dev]
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",
body: {
"chat_id": "-1001343736144",
text,
"parse_mode": "HTML"
}
})
console.log(await response.json())
}catch(error){
core.setFailed(error.message);
}