[ci] Add commit message to Telegram push

This commit is contained in:
kotori0 2021-01-30 17:33:53 +08:00
parent 47686e7aed
commit 5f8bdbe320
1 changed files with 3 additions and 1 deletions

View File

@ -54,5 +54,7 @@ jobs:
CHANNEL_ID: ${{ secrets.CHANNEL_ID }} CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
FILE: ${{ steps.sign.outputs.signedReleaseFile }} FILE: ${{ steps.sign.outputs.signedReleaseFile }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: | run: |
curl https://api.telegram.org/bot${BOT_TOKEN}/sendDocument -X POST -F chat_id="$CHANNEL_ID" -F document="@$FILE" ESCAPED=`echo $COMMIT_MESSAGE | python3 -c 'import json,sys,urllib.parse; print(urllib.parse.quote(json.dumps(sys.stdin.read())))'`
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://debug%22,%22caption%22:${ESCAPED}%7D%5D" -F release="@$release"