Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lrlunin committed Oct 17, 2024
1 parent a76db68 commit f184378
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/publish_in_telegram.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ on:
jobs:
post-and-pin:
runs-on: ubuntu-latest
env:
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
LAST_PINNED_MESSAGE: ${{ vars.LAST_PINNED_MESSAGE }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Send Telegram message with new files and get message ID
id: send_telegram_message # ID to reference this step's output
env:
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
run: |
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot$TG_BOT_TOKEN/sendMediaGroup" \
-F "chat_id=$CHAT_ID" \
Expand All @@ -33,7 +34,6 @@ jobs:
- name: Unpin previous bot message
env:
CHAT_ID: ${{ secrets.CHAT_ID }}
LAST_PINNED_MESSAGE: ${{ vars.LAST_PINNED_MESSAGE }}
if: steps.send_telegram_message.outcome == 'success' && ${{ vars.LAST_PINNED_MESSAGE }} != 0
run: |
Expand All @@ -44,8 +44,6 @@ jobs:
- name: Pin the sent message
if: steps.send_telegram_message.outcome == 'success'
env:
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
MESSAGE_ID: ${{ env.MESSAGE_ID }}
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
Expand Down

0 comments on commit f184378

Please sign in to comment.