Update android.yml

This commit is contained in:
Sujal 2025-02-19 19:06:42 +05:30 committed by GitHub
parent 5a12ca5500
commit 02f2dbebdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -113,15 +113,11 @@ jobs:
- name: Comment on PR with APK download links - name: Comment on PR with APK download links
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
uses: actions/github-script@v6 uses: actions/github-script@v6
env:
GH_TOKEN: ${{ github.token }}
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
script: | script: |
try { try {
const octokit = github.getOctokit(process.env.GH_TOKEN); const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
const { data: { artifacts } } = await octokit.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
run_id: context.runId run_id: context.runId
@ -141,13 +137,16 @@ jobs:
const betaDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/suites/${context.runId}/artifacts/${betaArtifact.id}`; const betaDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/suites/${context.runId}/artifacts/${betaArtifact.id}`;
const prodDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/suites/${context.runId}/artifacts/${prodArtifact.id}`; const prodDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/suites/${context.runId}/artifacts/${prodArtifact.id}`;
await octokit.rest.issues.createComment({ await github.rest.issues.createComment({
...context.repo, owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number, issue_number: context.issue.number,
body: ` body: `
📱 **APK for pull request is ready to see the changes** 📱 📱 **APK for pull request is ready to see the changes** 📱
- [Download Beta APK](${betaDownloadUrl}) - [Download Beta APK](${betaDownloadUrl})
- [Download Prod APK](${prodDownloadUrl}) - [Download Prod APK](${prodDownloadUrl})
*Note: You need to be logged in to GitHub to download the APKs.*
` `
}); });
} catch (error) { } catch (error) {