Skip to content

Commit

Permalink
workflow: fix size report
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 12, 2024
1 parent 67cdb5f commit 765abf8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/size-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ jobs:

- name: Read PR Number
id: pr-number
run: echo "number=(cat ./temp/size/number.txt)" >> $GITHUB_OUTPUT
uses: juliangruber/read-file-action@v1
with:
path: temp/size/number.txt

- name: Read base branch
id: pr-base
run: echo "base=(cat ./temp/size/base.txt)" >> $GITHUB_OUTPUT
uses: juliangruber/read-file-action@v1
with:
path: temp/size/base.txt

- name: Download Previous Size Data
uses: dawidd6/action-download-artifact@v6
with:
branch: ${{ steps.pr-base.outputs.base }}
branch: ${{ steps.pr-base.outputs.content }}
workflow: size-data.yml
event: push
name: size-data
Expand All @@ -73,7 +77,7 @@ jobs:
uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.pr-number.outputs.number }}
number: ${{ steps.pr-number.outputs.content }}
body: |
${{ steps.size-report.outputs.content }}
<!-- VUE_CORE_SIZE -->
Expand Down
3 changes: 2 additions & 1 deletion scripts/size-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ async function run() {
}

async function renderFiles() {
const filterFiles = (files: string[]) => files.filter(file => file[0] !== '_')
const filterFiles = (files: string[]) =>
files.filter(file => file[0] !== '_' && !file.endsWith('.txt'))

const curr = filterFiles(await readdir(currDir))
const prev = existsSync(prevDir) ? filterFiles(await readdir(prevDir)) : []
Expand Down

0 comments on commit 765abf8

Please sign in to comment.