From e226f48c91fdccc2de36177574d7f9e96391345a Mon Sep 17 00:00:00 2001 From: Land <84073086+LandWarderer2772@users.noreply.github.com> Date: Thu, 1 Jan 2026 09:57:40 +0000 Subject: [PATCH 1/2] Refactor Discord notification payloads --- .github/workflows/discord_notifications.yml | 6 +++++- .github/workflows/release.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/discord_notifications.yml b/.github/workflows/discord_notifications.yml index ea0973c9a2..69ba03b258 100644 --- a/.github/workflows/discord_notifications.yml +++ b/.github/workflows/discord_notifications.yml @@ -85,7 +85,11 @@ jobs: echo "TAG=$TAG" >> $GITHUB_OUTPUT echo "NAME=$NAME" >> $GITHUB_OUTPUT echo "URL=$URL" >> $GITHUB_OUTPUT - echo "BODY=$BODY" >> $GITHUB_OUTPUT + { + echo "BODY<> $GITHUB_OUTPUT - name: Send to Discord (releases) env: WEBHOOK_RELEASES: ${{ secrets.DISCORD_WEBHOOK_RELEASES }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e8684585b..7931605fe5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_BUILD }} run: | if [ -z "$WEBHOOK" ]; then exit 0; fi - payload=$(jq -n --arg content "Build started for ${{ github.ref_name }}") + payload=$(jq -n --arg content "Build started for ${{ github.ref_name }}" '{content: $content}') curl -s -H "Content-Type: application/json" -d "$payload" "$WEBHOOK" || true - name: Checkout code @@ -38,7 +38,7 @@ jobs: WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_BUILD }} run: | if [ -z "$WEBHOOK" ]; then exit 0; fi - payload=$(jq -n --arg content "Environment setup complete (Java 17, Android SDK)") + payload=$(jq -n --arg content "Environment setup complete (Java 17, Android SDK)" '{content: $content}') curl -s -H "Content-Type: application/json" -d "$payload" "$WEBHOOK" || true - name: Get version from tag @@ -62,7 +62,7 @@ jobs: WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_BUILD }} run: | if [ -z "$WEBHOOK" ]; then exit 0; fi - payload=$(jq -n --arg content "Keystore decoded") + payload=$(jq -n --arg content "Keystore decoded" '{content: $content}') curl -s -H "Content-Type: application/json" -d "$payload" "$WEBHOOK" || true - name: Build release APK @@ -81,7 +81,7 @@ jobs: WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_BUILD }} run: | if [ -z "$WEBHOOK" ]; then exit 0; fi - payload=$(jq -n --arg content "Release APK build complete") + payload=$(jq -n --arg content "Release APK build complete" '{content: $content}') curl -s -H "Content-Type: application/json" -d "$payload" "$WEBHOOK" || true - name: Create Release @@ -102,7 +102,7 @@ jobs: RELEASE_URL: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }} run: | if [ -z "$WEBHOOK" ]; then exit 0; fi - payload=$(jq -n --arg content "Release published: ${{ github.ref_name }}\n$RELEASE_URL") + payload=$(jq -n --arg content "Release published: ${{ github.ref_name }}\n$RELEASE_URL" '{content: $content}') curl -s -H "Content-Type: application/json" -d "$payload" "$WEBHOOK" || true - name: Clean up keystore @@ -115,5 +115,5 @@ jobs: WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_BUILD }} run: | if [ -z "$WEBHOOK" ]; then exit 0; fi - payload=$(jq -n --arg content "Build failed for ${{ github.ref_name }}\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}") + payload=$(jq -n --arg content "Build failed for ${{ github.ref_name }}\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" '{content: $content}') curl -s -H "Content-Type: application/json" -d "$payload" "$WEBHOOK" || true From 75cf86624930421563392c134509f6bbb14b6f30 Mon Sep 17 00:00:00 2001 From: Land <84073086+LandWarderer2772@users.noreply.github.com> Date: Thu, 1 Jan 2026 09:57:52 +0000 Subject: [PATCH 2/2] Add GitHub Action to comment PR with debug APK artifact link --- .github/workflows/debug.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 7a5c1f5b16..7a3c31650e 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -33,3 +33,17 @@ jobs: name: debug-apk path: app/build/outputs/apk/debug/app-debug.apk retention-days: 7 + + - name: Comment PR with artifact link + if: success() + uses: actions/github-script@v7 + with: + script: | + const runUrl = `https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}`; + const comment = `Debug APK built successfully!\n\nDownload artifact: [debug-apk](${runUrl})\n\n_Artifact will be available for 7 days_`; + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + });