Skip to content

Commit

Permalink
workflow: add tg-notify; update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Nov 29, 2024
1 parent 9dc7899 commit 607ba42
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 59 deletions.
172 changes: 172 additions & 0 deletions .github/scripts/tg-notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
#!/bin/bash

SILENT=false
if [ "$1" == "-s" ]; then
SILENT=true
shift
fi

if [ $# -lt 4 ]; then
echo "Usage: $0 <TG_TOKEN> <TG_CHANNEL> [TG_TOPIC] <MESSAGE_TYPE> [options]"
echo "MESSAGE_TYPE: start | finish | completed | error"
echo
echo "Options:"
echo " start <BUILD_NAME> <JOB_ID> <REPOSITORY>"
echo " Send a 'build started' message."
echo
echo " finish <BUILD_NAME> <ELAPSED_TIME> <JOB_ID> <REPOSITORY>"
echo " Send a 'build completed' message with elapsed time."
echo
echo " completed <BUILD_NAME> <JOB_ID> <REPOSITORY> <COMMIT_HASH> <BRANCH> <TAG_NAME> <TIME> <FILE_PATH>"
echo " Send a 'build completed with binaries' message, optionally attaching a file."
echo
echo " error <BUILD_NAME> <ERROR_MESSAGE> <JOB_ID> <REPOSITORY>"
echo " Send a 'build failed' message."
exit 1
fi

# Arguments
TG_TOKEN="$1"
TG_CHANNEL="$2"

if [[ "$3" =~ ^(start|finish|completed|error)$ ]]; then
TG_TOPIC=""
MESSAGE_TYPE="$3"
BUILD_NAME="$4"
shift 4
else
TG_TOPIC="$3"
MESSAGE_TYPE="$4"
BUILD_NAME="$5"
shift 5
fi

# Default Options
TG_OPTIONS="$([ "$SILENT" == true ] && echo '-s -o /dev/null' || echo '')"
API_URL="https://api.telegram.org/bot${TG_TOKEN}"

# Escape MarkdownV2 special characters
escape_markdown() {
local text="$1"
echo -e "$text" | sed -E \
-e 's/\\/\\\\/g' \
-e 's/\*/\\*/g' \
-e 's/_/\\_/g' \
-e 's/\{/\\{/g' \
-e 's/\}/\\}/g' \
-e 's/#/\\#/g' \
-e 's/\+/\\+/g' \
-e 's/-/\\-/g' \
-e 's/\./\\./g' \
-e 's/!/\\!/g' \
-e 's/\|/\\|/g' \
-e 's/>/\\>/g' \
-e 's/=/\\=/g' \
-e 's/`/\\`/g' \
-e 's/~/\\~/g' \
-e 's/</\\</g' \
-e 's/\$/\\\$/g' \
-e 's/:/\\:/g'
}

send_message() {
local message="$1"
local topic="$2"

if [ -n "$topic" ]; then
curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST "$API_URL/sendMessage" \
-F parse_mode=MarkdownV2 \
-F message_thread_id="$topic" \
-F chat_id="$TG_CHANNEL" \
-F text="$message" \
-F disable_web_page_preview=true
else
curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST "$API_URL/sendMessage" \
-F parse_mode=MarkdownV2 \
-F chat_id="$TG_CHANNEL" \
-F text="$message" \
-F disable_web_page_preview=true
fi
}

send_file() {
local message="$1"
local topic="$2"
local file_path="$3"

if [ -n "$topic" ]; then
curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST \
"$API_URL/sendDocument" \
-F parse_mode=MarkdownV2 \
-F chat_id="$TG_CHANNEL" \
-F message_thread_id="$topic" \
-F caption="$message" \
-F document=@"$file_path" \
-F disable_web_page_preview=true
else
curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST \
"$API_URL/sendDocument" \
-F parse_mode=MarkdownV2 \
-F chat_id="$TG_CHANNEL" \
-F caption="$message" \
-F document=@"$file_path" \
-F disable_web_page_preview=true
fi
}

# Message Types
case "$MESSAGE_TYPE" in
start)
JOB_ID="$1"
REPOSITORY="$2"
JOB_LINK="https://github.com/${REPOSITORY}/actions/runs/${JOB_ID}"
MESSAGE="${BUILD_NAME} build started:\nJob: [${JOB_ID}](${JOB_LINK})\n\n🚦 GitHub Actions"
MESSAGE=$(escape_markdown "$MESSAGE")
send_message "$MESSAGE" "$TG_TOPIC"
;;
finish)
ELAPSED="$1"
JOB_ID="$2"
REPOSITORY="$3"
JOB_LINK="https://github.com/${REPOSITORY}/actions/runs/${JOB_ID}"
MESSAGE="${BUILD_NAME} build completed:\nTotal elapsed time: ${ELAPSED}\nJob: [${JOB_ID}](${JOB_LINK})\n\n🚩 GitHub Actions"
MESSAGE=$(escape_markdown "$MESSAGE")
send_message "$MESSAGE" "$TG_TOPIC"
;;
completed)
JOB_ID="$1"
REPOSITORY="$2"
COMMIT_HASH="$3"
BRANCH="$4"
TAG_NAME="$5"
TIME="$6"
FILE_PATH="$7"

JOB_LINK="https://github.com/${REPOSITORY}/actions/runs/${JOB_ID}"
COMMIT_LINK="https://github.com/${REPOSITORY}/commit/${COMMIT_HASH}"
BRANCH_LINK="https://github.com/${REPOSITORY}/tree/${BRANCH}"
TAG_LINK="https://github.com/${REPOSITORY}/releases/tag/${TAG_NAME}"

MESSAGE="Commit: [${COMMIT_HASH}](${COMMIT_LINK})\nBranch: [${BRANCH}](${BRANCH_LINK})\nTag: [${TAG_NAME}](${TAG_LINK})\nTime: ${TIME}\nJob: [${JOB_ID}](${JOB_LINK})\n\n✅ GitHub Actions"
MESSAGE=$(escape_markdown "$MESSAGE")

if [ -f "$FILE_PATH" ]; then
send_file "$MESSAGE" "$TG_TOPIC" "$FILE_PATH"
else
send_message "$MESSAGE" "$TG_TOPIC"
fi
;;
error)
ERROR_MESSAGE="$1"
JOB_ID="$2"
REPOSITORY="$3"
JOB_LINK="https://github.com/${REPOSITORY}/actions/runs/${JOB_ID}"
MESSAGE="${BUILD_NAME} build failed:\nError: ${ERROR_MESSAGE}\nJob: [${JOB_ID}](${JOB_LINK})\n\n❌ GitHub Actions"
MESSAGE=$(escape_markdown "$MESSAGE")
send_message "$MESSAGE" "$TG_TOPIC"
;;
*)
echo "Unknown MESSAGE_TYPE: $MESSAGE_TYPE"
exit 1
;;
esac
45 changes: 14 additions & 31 deletions .github/workflows/firmware-module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ env:
TG_CHANNEL: -1002083893006_14394
TG_TOPIC: 14394
TG_CHANNEL_SCRATCH: ${{secrets.TELEGRAM_CHANNEL_THINGINO_SCRATCH}}
TG_OPTIONS: -s
FORCE_UNSAFE_CONFIGURE: 1
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TG_DISABLED: true
Expand All @@ -64,22 +63,20 @@ jobs:
echo "TG_DISABLED=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_ENV
echo "tg_disabled=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_OUTPUT
- name: Setup Notification Channel
if: ${{ github.event.inputs.tg_scratch == 'true' }}
run: |
echo "TG_TOPIC=" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: "master"
fetch-depth: "1"

- name: Send build start notifcation via Telegram
if: env.TG_DISABLED == 'false'
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
TG_MSG="Firmware\\-module build started:\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xF0\x9F\x9A\xA6 GitHub Actions"
TG_HEADER=$(echo -e ${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
.github/scripts/tg-notify.sh -s $TG_TOKEN $TG_CHANNEL $TG_TOPIC start $TAG_NAME ${{ github.run_id }} ${{ github.repository }}
generate-matrix:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -163,8 +160,6 @@ jobs:
echo "CURRENT_YEAR=$(date +%Y)" >> $GITHUB_ENV
echo "GIT_HASH=$(git rev-parse --short ${GITHUB_SHA})" >> $GITHUB_ENV
echo "GIT_BRANCH=${GITHUB_REF_NAME}" >> $GITHUB_ENV
echo "GIT_HASH=${GIT_HASH}" >> ${GITHUB_ENV}
echo "GIT_BRANCH=${GIT_BRANCH}" >> ${GITHUB_ENV}
echo "TG_DISABLED=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_ENV
TAG_NAME="$TAG_NAME-$(date +'%Y-%m-%d')"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
Expand Down Expand Up @@ -217,6 +212,7 @@ jobs:
echo "debug sha" > ${HOME}/output/${DYNAMIC_PART}/images/thingino-${DYNAMIC_PART}.bin.sha256sum
echo "debug" > ${HOME}/output/${DYNAMIC_PART}/images/thingino-${DYNAMIC_PART}-update.bin
echo "debug sha" > ${HOME}/output/${DYNAMIC_PART}/images/thingino-${DYNAMIC_PART}-update.bin.sha256sum
echo "TIME=7:77" >> ${GITHUB_ENV}
- name: Generate build time graphs
if: ${{ github.event.inputs.graph_enabled == 'true' }}
Expand Down Expand Up @@ -290,30 +286,20 @@ jobs:
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
TG_ESCAPED_TAG_NAME=$(echo "${TAG_NAME}" | sed 's/_/\\_/g')
if [ -n "${{ env.FULL_FW }}" ]; then
ESCAPED_TAG_NAME=$(echo "${TAG_NAME}" | sed 's/-/\\-/g')
TG_MSG="Commit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${ESCAPED_TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${ESCAPED_TAG_NAME})\nBuild Time: ${TIME}\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_HEADER=$(echo -e "${TG_MSG}\xE2\x9C\x85 GitHub Actions")
HTTP_FULL=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendDocument -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F caption="${TG_HEADER}" -F document=@${FULL_FW} -F disable_web_page_preview=true)
echo "Telegram response Full Firmware: $HTTP_FULL"
.github/scripts/tg-notify.sh -s $TG_TOKEN $TG_CHANNEL $TG_TOPIC completed $TAG_NAME ${{ github.run_id }} ${{ github.repository }} ${GIT_HASH} ${GIT_BRANCH} ${TAG_NAME} ${TIME} ${FULL_FW}
fi
- name: Send error notification
if: ${{ env.TG_DISABLED == 'false' && failure() }}
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
TG_ESCAPED_VERSION=$(echo "${{ matrix.thingino-version }}" | sed 's/_/\\_/g')
TG_WARN="Error: ${TG_ESCAPED_VERSION}\n"
TG_MSG="Commit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${TAG_NAME})\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xE2\x9A\xA0 GitHub Actions"
TG_HEADER=$(echo -e ${TG_WARN}${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
.github/scripts/tg-notify.sh -s $TG_TOKEN $TG_CHANNEL $TG_TOPIC error $TAG_NAME ${{ github.run_id }} ${{ github.repository }}
notify-completion:
needs: [buildroot, notify-begin]
Expand All @@ -335,14 +321,11 @@ jobs:
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
START_TIME=${{ needs.notify-begin.outputs.start_time }}
END_TIME=$(date -u +%s)
ELAPSED=$((END_TIME - START_TIME))
ELAPSED_MIN=$((ELAPSED / 60))
ELAPSED_SEC=$((ELAPSED % 60))
TG_MSG="Firmware\\-module build completed:\nTotal elapsed time: ${ELAPSED_MIN}m ${ELAPSED_SEC}s\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xF0\x9F\x9A\xA9 GitHub Actions"
TG_HEADER=$(echo -e ${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
.github/scripts/tg-notify.sh $TG_TOKEN $TG_CHANNEL $TG_TOPIC finish ${{ github.workflow }} "${ELAPSED_MIN}m ${ELAPSED_SEC}s" ${{ github.run_id }} ${{ github.repository }}
42 changes: 14 additions & 28 deletions .github/workflows/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ env:
TG_CHANNEL: -1002083893006_14394
TG_TOPIC: 14394
TG_CHANNEL_SCRATCH: ${{secrets.TELEGRAM_CHANNEL_THINGINO_SCRATCH}}
TG_OPTIONS: -s
FORCE_UNSAFE_CONFIGURE: 1
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -63,22 +62,20 @@ jobs:
echo "TG_DISABLED=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_ENV
echo "tg_disabled=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_OUTPUT
- name: Setup Notification Channel
if: ${{ github.event.inputs.tg_scratch == 'true' }}
run: |
echo "TG_TOPIC=" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: "master"
fetch-depth: "1"

- name: Send build start notifcation via Telegram
if: env.TG_DISABLED == 'false'
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
TG_MSG="Firmware build started:\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xF0\x9F\x9A\xA6 GitHub Actions"
TG_HEADER=$(echo -e ${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
.github/scripts/tg-notify.sh -s $TG_TOKEN $TG_CHANNEL $TG_TOPIC start $TAG_NAME ${{ github.run_id }} ${{ github.repository }}
generate-matrix:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -214,6 +211,7 @@ jobs:
echo "debug sha" > ${HOME}/output/${DYNAMIC_PART}/images/thingino-${DYNAMIC_PART}.bin.sha256sum
echo "debug" > ${HOME}/output/${DYNAMIC_PART}/images/thingino-${DYNAMIC_PART}-update.bin
echo "debug sha" > ${HOME}/output/${DYNAMIC_PART}/images/thingino-${DYNAMIC_PART}-update.bin.sha256sum
echo "TIME=7:77" >> ${GITHUB_ENV}
- name: Generate build time graphs
if: ${{ github.event.inputs.graph_enabled == 'true' }}
Expand Down Expand Up @@ -289,29 +287,20 @@ jobs:
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
if [ -n "${{ env.FULL_FW }}" ]; then
ESCAPED_TAG_NAME=$(echo "${TAG_NAME}" | sed 's/-/\\-/g')
TG_MSG="Commit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${ESCAPED_TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${ESCAPED_TAG_NAME})\nBuild Time: ${TIME}\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_HEADER=$(echo -e "${TG_MSG}\xE2\x9C\x85 GitHub Actions")
HTTP_FULL=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendDocument -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F caption="${TG_HEADER}" -F document=@${FULL_FW} -F disable_web_page_preview=true)
echo "Telegram response Full Firmware: $HTTP_FULL"
.github/scripts/tg-notify.sh -s $TG_TOKEN $TG_CHANNEL $TG_TOPIC completed $TAG_NAME ${{ github.run_id }} ${{ github.repository }} ${GIT_HASH} ${GIT_BRANCH} ${TAG_NAME} ${TIME} ${FULL_FW}
fi
- name: Send error notification
if: ${{ env.TG_DISABLED == 'false' && failure() }}
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
TG_ESCAPED_VERSION=$(echo "${{ matrix.thingino-version }}" | sed 's/_/\\_/g')
TG_WARN="Error: ${TG_ESCAPED_VERSION}\n"
TG_MSG="Commit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${TAG_NAME})\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xE2\x9A\xA0 GitHub Actions"
TG_HEADER=$(echo -e ${TG_WARN}${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
.github/scripts/tg-notify.sh -s $TG_TOKEN $TG_CHANNEL $TG_TOPIC error $TAG_NAME ${{ github.run_id }} ${{ github.repository }}
notify-completion:
needs: [buildroot, notify-begin]
Expand Down Expand Up @@ -386,14 +375,11 @@ jobs:
run: |
if [[ "${{ github.event.inputs.tg_scratch }}" == 'true' ]]; then
TG_CHANNEL=${{ env.TG_CHANNEL_SCRATCH }}
export TG_TOPIC=""
fi
START_TIME=${{ needs.notify-begin.outputs.start_time }}
END_TIME=$(date -u +%s)
ELAPSED=$((END_TIME - START_TIME))
ELAPSED_MIN=$((ELAPSED / 60))
ELAPSED_SEC=$((ELAPSED % 60))
TG_MSG="Firmware build completed:\nTotal build time: ${ELAPSED_MIN}m ${ELAPSED_SEC}s\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xF0\x9F\x9A\xA9 GitHub Actions"
TG_HEADER=$(echo -e ${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F message_thread_id=${TG_TOPIC} -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
.github/scripts/tg-notify.sh $TG_TOKEN $TG_CHANNEL $TG_TOPIC finish ${{ github.workflow }} "${ELAPSED_MIN}m ${ELAPSED_SEC}s" ${{ github.run_id }} ${{ github.repository }}

0 comments on commit 607ba42

Please sign in to comment.