mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Update android.yml
This commit is contained in:
parent
02f2dbebdb
commit
78361bb912
1 changed files with 12 additions and 5 deletions
17
.github/workflows/android.yml
vendored
17
.github/workflows/android.yml
vendored
|
|
@ -3,11 +3,16 @@ name: Android CI
|
|||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
pull-requests: write
|
||||
issues: write
|
||||
actions: read
|
||||
actions: write
|
||||
checks: write
|
||||
discussions: write
|
||||
packages: write
|
||||
repository-projects: write
|
||||
security-events: write
|
||||
statuses: write
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event.pull_request.number || github.ref }}
|
||||
|
|
@ -114,7 +119,7 @@ jobs:
|
|||
if: github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
try {
|
||||
const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
|
|
@ -134,8 +139,8 @@ jobs:
|
|||
throw new Error('Could not find both Beta and Prod APK artifacts.');
|
||||
}
|
||||
|
||||
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 betaDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${betaArtifact.id}`;
|
||||
const prodDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${prodArtifact.id}`;
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
|
|
@ -149,6 +154,8 @@ jobs:
|
|||
*Note: You need to be logged in to GitHub to download the APKs.*
|
||||
`
|
||||
});
|
||||
console.log('Successfully created comment with APK links');
|
||||
} catch (error) {
|
||||
console.error('Error details:', error);
|
||||
core.setFailed(`Action failed: ${error.message}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue