Skip to content

Commit 70e7329

Browse files
committed
workflow: simplify size report
1 parent 23e0988 commit 70e7329

File tree

2 files changed

+7
-52
lines changed

2 files changed

+7
-52
lines changed

.github/workflows/size-data.yml

-18
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
branches:
66
- main
77
- minor
8-
pull_request:
9-
branches:
10-
- main
11-
- minor
128

139
permissions:
1410
contents: read
@@ -42,17 +38,3 @@ jobs:
4238
with:
4339
name: size-data
4440
path: temp/size
45-
46-
- name: Save PR number & base branch
47-
if: ${{github.event_name == 'pull_request'}}
48-
run: |
49-
echo ${{ github.event.number }} > ./number.txt
50-
echo ${{ github.base_ref }} > ./base.txt
51-
52-
- uses: actions/upload-artifact@v4
53-
if: ${{github.event_name == 'pull_request'}}
54-
with:
55-
name: pr-info
56-
path: |
57-
number.txt
58-
base.txt

.github/workflows/size-report.yml

+7-34
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: size report
22

33
on:
4-
workflow_run:
5-
workflows: ['size data']
6-
types:
7-
- completed
4+
pull_request:
5+
branches:
6+
- main
7+
- minor
88

99
permissions:
1010
contents: read
@@ -17,9 +17,6 @@ env:
1717
jobs:
1818
size-report:
1919
runs-on: ubuntu-latest
20-
if: >
21-
github.event.workflow_run.event == 'pull_request' &&
22-
github.event.workflow_run.conclusion == 'success'
2320
steps:
2421
- uses: actions/checkout@v4
2522

@@ -35,36 +32,12 @@ jobs:
3532
- name: Install dependencies
3633
run: pnpm install
3734

38-
- name: Download PR info
39-
uses: dawidd6/action-download-artifact@v6
40-
with:
41-
name: pr-info
42-
run_id: ${{ github.event.workflow_run.id }}
43-
path: /tmp/pr-info
44-
45-
- name: Read PR Number
46-
id: pr-number
47-
uses: juliangruber/read-file-action@v1
48-
with:
49-
path: /tmp/pr-info/number.txt
50-
51-
- name: Read PR base branch
52-
id: pr-base
53-
uses: juliangruber/read-file-action@v1
54-
with:
55-
path: /tmp/pr-info/base.txt
56-
57-
- name: Download Size Data
58-
uses: dawidd6/action-download-artifact@v6
59-
with:
60-
name: size-data
61-
run_id: ${{ github.event.workflow_run.id }}
62-
path: temp/size
35+
- run: pnpm run size
6336

6437
- name: Download Previous Size Data
6538
uses: dawidd6/action-download-artifact@v6
6639
with:
67-
branch: ${{ steps.pr-base.outputs.content }}
40+
branch: ${{ github.base_ref }}
6841
workflow: size-data.yml
6942
event: push
7043
name: size-data
@@ -84,7 +57,7 @@ jobs:
8457
uses: actions-cool/maintain-one-comment@v3
8558
with:
8659
token: ${{ secrets.GITHUB_TOKEN }}
87-
number: ${{ steps.pr-number.outputs.content }}
60+
number: ${{ github.event.number }}
8861
body: |
8962
${{ steps.size-report.outputs.content }}
9063
<!-- VUE_CORE_SIZE -->

0 commit comments

Comments
 (0)