Skip to content

Commit

Permalink
[ci] fix tg bot data
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Dec 11, 2024
1 parent 7236eb1 commit a338491
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
T1_CONFIG: ${{ matrix.config }}
PD_URL: ${{ secrets.T1_INHOUSE_URL }}
run: |
set -e
# GitHub `toJson` will pretty print JSON and causing multiple line escape issue
# So we have to redirect it to file here
printf "$JSON_CTX" > _ctx.json
Expand Down Expand Up @@ -115,9 +116,9 @@ jobs:
| jq -Rn '[inputs | { media: "attach://\(.)", type: "document" }]')
DOCUMENTS=( $(find "${_OUTPUT_DIR}/reports" -type f -name '*.rpt' -printf '-F\n%f=@%p\n') )
BOT_TOKEN=$( echo ${{ secrets.T1_BACKEND_REPORT_ENDPOINT_DATA }} | cut -d';' -f1 )
CHAT_ID=$( echo ${{ secrets.T1_BACKEND_REPORT_ENDPOINT_DATA }} | cut -d';' -f2 )
TOPIC_ID=$( echo ${{ secrets.T1_BACKEND_REPORT_ENDPOINT_DATA }} | cut -d';' -f3 )
BOT_TOKEN=$( echo "${{ secrets.T1_BACKEND_REPORT_ENDPOINT_DATA }}" | cut -d';' -f1 )
CHAT_ID=$( echo "${{ secrets.T1_BACKEND_REPORT_ENDPOINT_DATA }}" | cut -d';' -f2 )
TOPIC_ID=$( echo "${{ secrets.T1_BACKEND_REPORT_ENDPOINT_DATA }}" | cut -d';' -f3 )
# Send information first
nix run nixpkgs#curl -- -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
-d "chat_id=$CHAT_ID" \
Expand Down

0 comments on commit a338491

Please sign in to comment.