@@ -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 }}
@@ -63,15 +57,17 @@ jobs:
6357
6458 return await main()
6559
66- - name : Comment on the pull request (if any failure)
67- if : ${{ failure() }}
68- uses : marocchino/sticky-pull-request-comment@v2
60+ - name : Persist the diff
61+ uses : actions/github-script@v7
6962 with :
70- message : |
71- ❌ The dist files size difference could not be calculated. Please check the logs for more details.
63+ result-encoding : string
64+ script : |
65+ const fs = require('fs')
7266
73- - name : Comment on the pull request (if success)
74- if : ${{ always() && steps.diff.conclusion == 'success' }}
75- uses : marocchino/sticky-pull-request-comment@v2
67+ fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size.md', JSON.stringify(${{ steps.diff.outputs.result }}))
68+
69+ - name : Upload the diff
70+ uses : actions/upload-artifact@v4
7671 with :
77- message : ${{ steps.diff.outputs.result }}
72+ name : dist-size-${{ github.event.number }}
73+ path : ./dist-size.md
0 commit comments