Skip to content

Commit cffe866

Browse files
committed
workflow: simplify size report action
1 parent 23e0988 commit cffe866

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

.github/workflows/size-data.yml

+6-14
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,14 @@ jobs:
3737

3838
- run: pnpm run size
3939

40-
- name: Upload Size Data
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: size-data
44-
path: temp/size
45-
4640
- name: Save PR number & base branch
4741
if: ${{github.event_name == 'pull_request'}}
4842
run: |
49-
echo ${{ github.event.number }} > ./number.txt
50-
echo ${{ github.base_ref }} > ./base.txt
43+
echo ${{ github.event.number }} > ./temp/size/number.txt
44+
echo ${{ github.base_ref }} > ./temp/size/base.txt
5145
52-
- uses: actions/upload-artifact@v4
53-
if: ${{github.event_name == 'pull_request'}}
46+
- name: Upload Size Data
47+
uses: actions/upload-artifact@v4
5448
with:
55-
name: pr-info
56-
path: |
57-
number.txt
58-
base.txt
49+
name: size-data
50+
path: temp/size

.github/workflows/size-report.yml

+8-19
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,25 @@ jobs:
3535
- name: Install dependencies
3636
run: pnpm install
3737

38-
- name: Download PR info
38+
- name: Download Size Data
3939
uses: dawidd6/action-download-artifact@v6
4040
with:
41-
name: pr-info
41+
name: size-data
4242
run_id: ${{ github.event.workflow_run.id }}
43-
path: /tmp/pr-info
43+
path: temp/size
4444

4545
- name: Read PR Number
4646
id: pr-number
47-
uses: juliangruber/read-file-action@v1
48-
with:
49-
path: /tmp/pr-info/number.txt
47+
run: echo "number=(cat ./temp/size/number.txt)" >> $GITHUB_OUTPUT
5048

51-
- name: Read PR base branch
49+
- name: Read base branch
5250
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
51+
run: echo "base=(cat ./temp/size/base.txt)" >> $GITHUB_OUTPUT
6352

6453
- name: Download Previous Size Data
6554
uses: dawidd6/action-download-artifact@v6
6655
with:
67-
branch: ${{ steps.pr-base.outputs.content }}
56+
branch: ${{ steps.pr-base.outputs.base }}
6857
workflow: size-data.yml
6958
event: push
7059
name: size-data
@@ -84,7 +73,7 @@ jobs:
8473
uses: actions-cool/maintain-one-comment@v3
8574
with:
8675
token: ${{ secrets.GITHUB_TOKEN }}
87-
number: ${{ steps.pr-number.outputs.content }}
76+
number: ${{ steps.pr-number.outputs.number }}
8877
body: |
8978
${{ steps.size-report.outputs.content }}
9079
<!-- VUE_CORE_SIZE -->

0 commit comments

Comments
 (0)