mirror of
https://github.com/ouchadam/small-talk.git
synced 2025-01-24 08:23:21 +01:00
using 3rd party download artifact action to allow downloading artifacts from the current workflow
This commit is contained in:
parent
fb878375cd
commit
fd4566c234
7
.github/workflows/check_size.yml
vendored
7
.github/workflows/check_size.yml
vendored
@ -38,11 +38,16 @@ jobs:
|
|||||||
echo "$(pwd)/bin" >> $GITHUB_PATH
|
echo "$(pwd)/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Save Size
|
- name: Save Size
|
||||||
|
env:
|
||||||
|
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./apk_size
|
mkdir -p ./apk_size
|
||||||
echo $(./tools/check-size.sh | tail -1 | cut -d ',' -f2-) > ./apk_size/size.txt
|
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
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: apk-size
|
name: apk-size
|
||||||
path: apk_size/size.txt
|
path: |
|
||||||
|
apk_size/size.txt
|
||||||
|
apk_size/pr_number.txt
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
12
.github/workflows/comment_size.yml
vendored
12
.github/workflows/comment_size.yml
vendored
@ -15,28 +15,30 @@ jobs:
|
|||||||
github.event.workflow_run.conclusion == 'success' }}
|
github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: dawidd6/action-download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: apk-size
|
name: apk-size
|
||||||
path: ~/apk-size.txt
|
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||||
|
|
||||||
- name: Check release size
|
- name: Check release size
|
||||||
run: |
|
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
|
id: size
|
||||||
|
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v1
|
uses: peter-evans/find-comment@v1
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ steps.size.outputs.PR_NUMBER }}
|
||||||
comment-author: 'github-actions[bot]'
|
comment-author: 'github-actions[bot]'
|
||||||
body-includes: APK Size
|
body-includes: APK Size
|
||||||
- name: Publish size to PR
|
- name: Publish size to PR
|
||||||
uses: peter-evans/create-or-update-comment@v1
|
uses: peter-evans/create-or-update-comment@v1
|
||||||
with:
|
with:
|
||||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ steps.size.outputs.PR_NUMBER }}
|
||||||
body: |
|
body: |
|
||||||
APK Size: ${{ steps.size.outputs.APK_SIZE }}
|
APK Size: ${{ steps.size.outputs.APK_SIZE }}
|
||||||
edit-mode: replace
|
edit-mode: replace
|
Loading…
Reference in New Issue
Block a user