Compare commits

...
4 Commits
10 ... 14
Author SHA1 Message Date
nezumi ae43197aa0 update config 2025-01-22 18:59:05 +07:00
nezumi c2fe93675e update config 2025-01-22 18:17:08 +07:00
nezumi aee01f1ca5 update config 2025-01-22 17:55:20 +07:00
nezumi 679631315e update config 2025-01-22 17:35:52 +07:00
2 changed files with 27 additions and 5 deletions
+26 -4
View File
@@ -147,9 +147,9 @@ jobs:
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST" curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"
- name: Report to Discord - name: Report to Discord
if: env.TG_TOKEN != null
env: env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
if: env.DISCORD_WEBHOOK_URL != null
run: | run: |
cd build || { echo "build folder not found"; exit 1; } cd build || { echo "build folder not found"; exit 1; }
@@ -181,6 +181,28 @@ jobs:
${APKS} ${APKS}
" "
curl -X POST -H "Content-Type: application/json" \ # Function to split messages properly by ensuring correct Markdown formatting
-d "$(jq -n --arg content "$MSG" '{content: $content}')" \ send_discord_message() {
"$DISCORD_WEBHOOK_URL" local message="$1"
local buffer=""
while IFS= read -r line || [ -n "$line" ]; do
# Check if adding the current line exceeds 2000 characters
if [ ${#buffer} -ge 2000 ]; then
# Send the current buffer and reset it
curl -X POST -H "Content-Type: application/json" \
-d "$(jq -n --arg content "$buffer" '{content: $content}')" \
"$DISCORD_WEBHOOK_URL"
buffer=""
fi
buffer+="${line}\n"
done <<< "$message"
# Send any remaining content in the buffer
if [ -n "$buffer" ]; then
curl -X POST -H "Content-Type: application/json" \
-d "$(jq -n --arg content "$buffer" '{content: $content}')" \
"$DISCORD_WEBHOOK_URL"
fi
}
send_discord_message "$MSG"
+1 -1
View File
@@ -46,5 +46,5 @@ jobs:
permissions: write-all permissions: write-all
needs: check needs: check
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }} if: ${{ needs.check.outputs.SHOULD_BUILD == 0 }}
secrets: inherit secrets: inherit