diff --git a/.github/workflows/pd.yml b/.github/workflows/pd.yml index 68b13b486..a2b3ea553 100644 --- a/.github/workflows/pd.yml +++ b/.github/workflows/pd.yml @@ -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 @@ -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" \