Merge pull request #1867 from vitorpamplona/claude/add-apk-pr-comments-gR7m7

Add direct APK download link and PR comments to benchmark workflow
This commit is contained in:
Vitor Pamplona
2026-03-17 09:01:12 -04:00
committed by GitHub
+18 -5
View File
@@ -43,14 +43,27 @@ jobs:
name: Play Benchmark APK
path: amethyst/build/outputs/apk/play/benchmark/amethyst-play-universal-benchmark.apk
- name: Comment on commit with APK link
- name: Comment on PR with APK link
uses: actions/github-script@v7
with:
script: |
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
await github.rest.repos.createCommitComment({
const artifactId = `${{ steps.upload.outputs.artifact-id }}`;
const downloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/artifacts/${artifactId}`;
const body = `📦 **Benchmark APK ready!**\n\nDownload: [Play Benchmark APK](${downloadUrl})`;
const branch = context.ref.replace('refs/heads/', '');
const { data: prs } = await github.rest.pulls.list({
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).`
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
});
}