@@ -2,26 +2,20 @@ name: Dist Files Size Diff
2
2
3
3
on :
4
4
pull_request :
5
+ types : [opened, synchronize]
5
6
paths :
6
7
- ' src/*/assets/dist/**'
7
8
- ' src/*/src/Bridge/*/assets/dist/**'
8
9
9
10
jobs :
10
11
dist-files-size-diff :
11
12
runs-on : ubuntu-latest
12
- permissions :
13
- pull-requests : write # for marocchino/sticky-pull-request-comment@v2
14
13
steps :
15
14
- name : Configure git
16
15
run : |
17
16
git config --global user.email ""
18
17
git config --global user.name "github-action[bot]"
19
18
20
- - uses : marocchino/sticky-pull-request-comment@v2
21
- with :
22
- message : |
23
- ⏳ The dist files size difference is being calculated...
24
-
25
19
- uses : actions/checkout@v4
26
20
with :
27
21
ref : ${{ github.base_ref }}
@@ -59,19 +53,16 @@ jobs:
59
53
with :
60
54
result-encoding : string
61
55
script : |
56
+ const fs = require('fs')
62
57
const { main } = await import('${{ github.workspace }}/.github/generate-dist-files-size-diff.mjs')
63
58
64
- return await main()
59
+ const diff = await main()
60
+ console.log(diff);
65
61
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)
72
63
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
76
66
with :
77
- message : ${{ steps.diff.outputs.result }}
67
+ name : dist-size-${{ github.event.number }}
68
+ path : ./dist-size.md
0 commit comments