Skip to content

Commit f345221

Browse files
committed
debug
1 parent b9fd13a commit f345221

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Dist Files Size Diff (Comment)
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Dist Files Size Diff"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
dist-files-size-diff:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Download artifact
14+
uses: actions/download-artifact@v4
15+
with:
16+
name: dist-size-${{ github.event.number }}
17+
18+
- name: Comment on the pull request (if success)
19+
if: ${{ always() && steps.diff.conclusion == 'success' }}
20+
uses: marocchino/sticky-pull-request-comment@v2
21+
with:
22+
path: ./dist-size.md

.github/workflows/dist-files-size-diff.yaml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,20 @@ name: Dist Files Size Diff
22

33
on:
44
pull_request:
5+
types: [opened, synchronize]
56
paths:
67
- 'src/*/assets/dist/**'
78
- 'src/*/src/Bridge/*/assets/dist/**'
89

910
jobs:
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

Comments
 (0)