mirror of
https://github.com/Nezumi-2711/revanced-apk-build.git
synced 2026-09-22 13:38:52 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7deb883720 | ||
|
|
be1c20bb87 |
+16
-31
@@ -174,41 +174,26 @@ jobs:
|
|||||||
${BODY}
|
${BODY}
|
||||||
|
|
||||||
**Download Links:**
|
**Download Links:**
|
||||||
|
"
|
||||||
|
|
||||||
|
MODULES_MSG="
|
||||||
**Modules:**
|
**Modules:**
|
||||||
${MODULES}
|
${MODULES}
|
||||||
|
"
|
||||||
|
|
||||||
|
APKS_MSG="
|
||||||
**APKs:**
|
**APKs:**
|
||||||
${APKS}
|
${APKS}
|
||||||
"
|
"
|
||||||
|
|
||||||
# Function to split messages properly by ensuring correct Markdown formatting
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
send_discord_message() {
|
-d "$(jq -n --arg content "$MSG" '{content: $content}')" \
|
||||||
local message="$1"
|
"$DISCORD_WEBHOOK_URL"
|
||||||
|
|
||||||
while [ ${#message} -gt 0 ]; do
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
# Attempt to find a safe split point within 2000 characters
|
-d "$(jq -n --arg content "$MODULES_MSG" '{content: $content}')" \
|
||||||
local chunk="${message:0:2000}"
|
"$DISCORD_WEBHOOK_URL"
|
||||||
local cutoff=$(echo "$chunk" | awk '{print length($0) - length($NF)}') # Find last space/newline within chunk
|
|
||||||
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
if [ $cutoff -gt 0 ] && [ $cutoff -lt 2000 ]; then
|
-d "$(jq -n --arg content "$APKS_MSG" '{content: $content}')" \
|
||||||
# Use safe cutoff point if available
|
"$DISCORD_WEBHOOK_URL"
|
||||||
chunk="${message:0:$cutoff}"
|
|
||||||
message="${message:$cutoff}"
|
|
||||||
else
|
|
||||||
# Default to cutting at the 2000-character limit
|
|
||||||
chunk="${message:0:2000}"
|
|
||||||
message="${message:2000}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove leading/trailing whitespace in the chunk and message
|
|
||||||
chunk=$(echo "$chunk" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
||||||
message=$(echo "$message" | sed 's/^[[:space:]]*//')
|
|
||||||
|
|
||||||
# Send the chunk to Discord
|
|
||||||
curl -X POST -H "Content-Type: application/json" \
|
|
||||||
-d "$(jq -n --arg content "$chunk" '{content: $content}')" \
|
|
||||||
"$DISCORD_WEBHOOK_URL"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
send_discord_message "$MSG"
|
|
||||||
|
|||||||
@@ -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 == 0 }}
|
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|||||||
Reference in New Issue
Block a user