Skip to content

Commit

Permalink
test: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
techmovie committed Oct 22, 2024
1 parent 72897e9 commit 2f25c4d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/telegram-channel.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: send telegram channel message
on:
push:
paths: 'dist/easy-upload.user.js'
branches: [master]
paths: '.github/**'
branches: [dev]
jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -11,20 +11,22 @@ jobs:
- 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"
const response = await fetch('https://api.telegram.org/bot${{secrets.TG_BOT_TOKEN}}/sendMessage',{
method: "POST",
body: {
"chat_id": "-1001343736144",
text,
"parse_mode": "HTML"
}
})
await response.json();
}catch(error){
core.setFailed(error.message);
}

0 comments on commit 2f25c4d

Please sign in to comment.