@@ -2,26 +2,20 @@ name: Dist Files Size Diff
22
33on :
44 pull_request :
5+ types : [opened, synchronize]
56 paths :
67 - ' src/*/assets/dist/**'
78 - ' src/*/src/Bridge/*/assets/dist/**'
89
910jobs :
1011 dist-files-size-diff :
1112 runs-on : ubuntu-latest
12- permissions :
13- pull-requests : write # for marocchino/sticky-pull-request-comment@v2
1413 steps :
1514 - name : Configure git
1615 run : |
1716 git config --global user.email ""
1817 git config --global user.name "github-action[bot]"
1918
20- - uses : marocchino/sticky-pull-request-comment@v2
21- with :
22- message : |
23- ⏳ The dist files size difference is being calculated...
24-
2519 - uses : actions/checkout@v4
2620 with :
2721 ref : ${{ github.base_ref }}
@@ -59,19 +53,16 @@ jobs:
5953 with :
6054 result-encoding : string
6155 script : |
56+ const fs = require('fs')
6257 const { main } = await import('${{ github.workspace }}/.github/generate-dist-files-size-diff.mjs')
6358
64- return await main()
59+ const diff = await main()
60+ console.log(diff);
6561
66- - name : Comment on the pull request (if any failure)
67- if : ${{ failure() }}
68- uses : marocchino/sticky-pull-request-comment@v2
69- with :
70- message : |
71- ❌ The dist files size difference could not be calculated. Please check the logs for more details.
62+ fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size.md', diff)
7263
73- - name : Comment on the pull request (if success)
74- if : ${{ always() && steps.diff.conclusion == 'success' }}
75- uses : marocchino/sticky-pull-request-comment@v2
64+ - name : Upload the diff
65+ uses : actions/upload-artifact@v4
7666 with :
77- message : ${{ steps.diff.outputs.result }}
67+ name : dist-size-${{ github.event.number }}
68+ path : ./dist-size.md
0 commit comments