From f39bcf2d8b1e41de471afda5843125a5d8c2e1c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 08:54:59 +0000 Subject: [PATCH 1/2] Initial plan From 4d6e4878e307c8937c5785556b46cdd9bc06836f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 08:57:17 +0000 Subject: [PATCH 2/2] Update PR action to post direct APK download link as sticky comment Agent-Logs-Url: https://github.com/LukeNeedham/VideoDiary/sessions/b3600516-6713-4077-924b-197564d6c654 Co-authored-by: LukeNeedham <49884591+LukeNeedham@users.noreply.github.com> --- .github/workflows/build-apk.yml | 44 ++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index 0f7385b..7d20c26 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + contents: write steps: - name: Checkout code @@ -37,21 +38,46 @@ jobs: - name: Build debug APK run: ./gradlew assembleDebug - - name: Upload APK artifact - uses: actions/upload-artifact@v4 + - name: Upload APK to PR release + uses: ncipollo/release-action@v1 with: - name: app-debug-pr-${{ github.event.pull_request.number }} - path: app/build/outputs/apk/debug/app-debug.apk - retention-days: 7 + tag: pr-${{ github.event.pull_request.number }} + name: PR #${{ github.event.pull_request.number }} Debug APK + artifacts: app/build/outputs/apk/debug/app-debug.apk + body: Automated debug APK for PR #${{ github.event.pull_request.number }}. Updated on each push. + allowUpdates: true + removeArtifacts: true + prerelease: true + token: ${{ secrets.GITHUB_TOKEN }} - - name: Post APK link in PR comment + - name: Post sticky APK link comment uses: actions/github-script@v7 with: script: | - const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; - await github.rest.issues.createComment({ + const marker = ''; + const apkUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/releases/download/pr-${context.issue.number}/app-debug.apk`; + const body = `${marker}\nāœ… Debug APK build complete!\n\nDownload APK directly: [app-debug.apk](${apkUrl})`; + + const comments = await github.rest.issues.listComments({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `āœ… Debug APK build complete!\n\nDownload the APK from the [workflow run artifacts](${runUrl}).`, }); + + const existing = comments.data.find(c => c.body.includes(marker)); + + if (existing) { + await github.rest.issues.updateComment({ + comment_id: existing.id, + owner: context.repo.owner, + repo: context.repo.repo, + body, + }); + } else { + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body, + }); + }