From 02f2dbebdb3b810c3c90ab385e74585b19e30568 Mon Sep 17 00:00:00 2001 From: Sujal Date: Wed, 19 Feb 2025 19:06:42 +0530 Subject: [PATCH] Update android.yml --- .github/workflows/android.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0488beed8..5501d009a 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -113,19 +113,15 @@ jobs: - name: Comment on PR with APK download links if: github.event_name == 'pull_request' uses: actions/github-script@v6 - env: - GH_TOKEN: ${{ github.token }} with: - github-token: ${{ github.token }} - script: | - try { - const octokit = github.getOctokit(process.env.GH_TOKEN); - - const { data: { artifacts } } = await octokit.rest.actions.listWorkflowRunArtifacts({ + github-token: ${{ github.token }} + script: | + try { + const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, run_id: context.runId - }); + }); if (!artifacts || artifacts.length === 0) { throw new Error('No artifacts found for this workflow run.'); @@ -141,13 +137,16 @@ jobs: 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}`; - await octokit.rest.issues.createComment({ - ...context.repo, + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, issue_number: context.issue.number, body: ` 📱 **APK for pull request is ready to see the changes** 📱 - - [Download Beta APK](${betaDownloadUrl}) - - [Download Prod APK](${prodDownloadUrl}) + - [Download Beta APK](${betaDownloadUrl}) + - [Download Prod APK](${prodDownloadUrl}) + + *Note: You need to be logged in to GitHub to download the APKs.* ` }); } catch (error) {