Skip to content

Commit a8e663b

Browse files
committed
Split workflows because of permissions issues
1 parent b9fd13a commit a8e663b

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
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: 9 additions & 18 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 }}
@@ -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

Comments
 (0)