From 39e15a89295ab2bf642181488c1f9868d0ede1b2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Mar 2026 03:23:00 +0000 Subject: [PATCH] feat: comment benchmark APK link on open PRs Add PR commenting to the build-benchmark-apk workflow. When a build completes, it now finds any open PR for the branch and posts a comment with a direct download link to the benchmark APK artifact. https://claude.ai/code/session_0138kUcZaPQoQcAc7nA1KDbf --- .github/workflows/build-benchmark-apk.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-benchmark-apk.yml b/.github/workflows/build-benchmark-apk.yml index a9e338b31..e3efc3674 100644 --- a/.github/workflows/build-benchmark-apk.yml +++ b/.github/workflows/build-benchmark-apk.yml @@ -48,9 +48,30 @@ jobs: with: script: | const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const artifactUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/artifacts/${{ steps.upload.outputs.artifact-id }}`; + const body = `📦 **Benchmark APK ready!**\n\nDownload: [Play Benchmark APK](${artifactUrl})\n\nOr view all artifacts in the [workflow run](${runUrl}#artifacts).`; + await github.rest.repos.createCommitComment({ owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha, - body: `📦 **Benchmark APK ready!**\n\nDownload it from the [workflow run artifacts](${runUrl}#artifacts).` + body }); + + // Find open PRs for this branch and comment on them + const branch = context.ref.replace('refs/heads/', ''); + const { data: prs } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + head: `${context.repo.owner}:${branch}`, + state: 'open' + }); + + for (const pr of prs) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + body + }); + }