2022-03-18 00:42:18 +01:00
|
|
|
name: Comment APK Size
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_run:
|
|
|
|
workflows: [ "Check Size" ]
|
|
|
|
types:
|
|
|
|
- completed
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
comment-size:
|
|
|
|
name: Comment Size
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: >
|
|
|
|
${{ github.event.workflow_run.event == 'pull_request' &&
|
|
|
|
github.event.workflow_run.conclusion == 'success' }}
|
|
|
|
|
|
|
|
steps:
|
2022-03-18 21:03:38 +01:00
|
|
|
- uses: dawidd6/action-download-artifact@v2
|
2022-03-18 00:42:18 +01:00
|
|
|
with:
|
|
|
|
name: apk-size
|
2022-03-18 21:03:38 +01:00
|
|
|
workflow: ${{ github.event.workflow_run.workflow_id }}
|
2022-03-18 00:42:18 +01:00
|
|
|
|
|
|
|
- name: Check release size
|
|
|
|
run: |
|
2022-03-18 21:03:38 +01:00
|
|
|
ls -R
|
|
|
|
echo "::set-output name=APK_SIZE::$(cat size.txt)"
|
|
|
|
echo "::set-output name=PR_NUMBER::$(cat pr_number.txt)"
|
2022-03-18 00:42:18 +01:00
|
|
|
id: size
|
|
|
|
|
|
|
|
- name: Find Comment
|
|
|
|
uses: peter-evans/find-comment@v1
|
|
|
|
id: fc
|
|
|
|
with:
|
2022-03-18 21:03:38 +01:00
|
|
|
issue-number: ${{ steps.size.outputs.PR_NUMBER }}
|
2022-03-18 00:42:18 +01:00
|
|
|
comment-author: 'github-actions[bot]'
|
|
|
|
body-includes: APK Size
|
|
|
|
- name: Publish size to PR
|
|
|
|
uses: peter-evans/create-or-update-comment@v1
|
|
|
|
with:
|
|
|
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
2022-03-18 21:03:38 +01:00
|
|
|
issue-number: ${{ steps.size.outputs.PR_NUMBER }}
|
2022-03-18 00:42:18 +01:00
|
|
|
body: |
|
|
|
|
APK Size: ${{ steps.size.outputs.APK_SIZE }}
|
|
|
|
edit-mode: replace
|