diff --git a/.github/workflows/check_size.yml b/.github/workflows/check_size.yml index 7dffbfd..5ab2303 100644 --- a/.github/workflows/check_size.yml +++ b/.github/workflows/check_size.yml @@ -38,11 +38,16 @@ jobs: echo "$(pwd)/bin" >> $GITHUB_PATH - name: Save Size + env: + PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} run: | mkdir -p ./apk_size echo $(./tools/check-size.sh | tail -1 | cut -d ',' -f2-) > ./apk_size/size.txt + echo $PULL_REQUEST_NUMBER > ./apk_size/pr_number.txt - uses: actions/upload-artifact@v3 with: name: apk-size - path: apk_size/size.txt + path: | + apk_size/size.txt + apk_size/pr_number.txt retention-days: 5 diff --git a/.github/workflows/comment_size.yml b/.github/workflows/comment_size.yml index 9ddd909..288b98c 100644 --- a/.github/workflows/comment_size.yml +++ b/.github/workflows/comment_size.yml @@ -15,28 +15,30 @@ jobs: github.event.workflow_run.conclusion == 'success' }} steps: - - uses: actions/download-artifact@v3 + - uses: dawidd6/action-download-artifact@v2 with: name: apk-size - path: ~/apk-size.txt + workflow: ${{ github.event.workflow_run.workflow_id }} - name: Check release size run: | - echo "::set-output name=APK_SIZE::$(cat ~/apk-size.txt)" + ls -R + echo "::set-output name=APK_SIZE::$(cat size.txt)" + echo "::set-output name=PR_NUMBER::$(cat pr_number.txt)" id: size - name: Find Comment uses: peter-evans/find-comment@v1 id: fc with: - issue-number: ${{ github.event.pull_request.number }} + issue-number: ${{ steps.size.outputs.PR_NUMBER }} 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 }} - issue-number: ${{ github.event.pull_request.number }} + issue-number: ${{ steps.size.outputs.PR_NUMBER }} body: | APK Size: ${{ steps.size.outputs.APK_SIZE }} edit-mode: replace \ No newline at end of file