ci: correct PR number retrieval to fix size-report action (#11223)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
parent
f2acd51340
commit
2f11a455e0
|
@ -41,3 +41,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: size-data
|
name: size-data
|
||||||
path: temp/size
|
path: temp/size
|
||||||
|
|
||||||
|
- name: Save PR number
|
||||||
|
if: ${{github.event_name == 'pull_request'}}
|
||||||
|
run: echo ${{ github.event.number }} > ./pr.txt
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: ${{github.event_name == 'pull_request'}}
|
||||||
|
with:
|
||||||
|
name: pr-number
|
||||||
|
path: pr.txt
|
||||||
|
|
|
@ -35,6 +35,19 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: Download PR number
|
||||||
|
uses: dawidd6/action-download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: pr-number
|
||||||
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
|
path: /tmp/pr-number
|
||||||
|
|
||||||
|
- name: Read PR Number
|
||||||
|
id: pr-number
|
||||||
|
uses: juliangruber/read-file-action@v1
|
||||||
|
with:
|
||||||
|
path: /tmp/pr-number/pr.txt
|
||||||
|
|
||||||
- name: Download Size Data
|
- name: Download Size Data
|
||||||
uses: dawidd6/action-download-artifact@v6
|
uses: dawidd6/action-download-artifact@v6
|
||||||
with:
|
with:
|
||||||
|
@ -55,10 +68,18 @@ jobs:
|
||||||
- name: Prepare report
|
- name: Prepare report
|
||||||
run: pnpm tsx scripts/size-report.ts > size-report.md
|
run: pnpm tsx scripts/size-report.ts > size-report.md
|
||||||
|
|
||||||
- name: Create Comment
|
- name: Read Size Report
|
||||||
uses: thollander/actions-comment-pull-request@v2.5.0
|
id: size-report
|
||||||
|
uses: juliangruber/read-file-action@v1
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
path: ./size-report.md
|
||||||
filePath: size-report.md
|
|
||||||
pr_number: ${{ github.event.workflow_run.pull_requests[0].number }}
|
- name: Create Comment
|
||||||
comment_tag: VUE_CORE_SIZE
|
uses: actions-cool/maintain-one-comment@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
number: ${{ steps.pr-number.outputs.content }}
|
||||||
|
body: |
|
||||||
|
${{ steps.size-report.outputs.content }}
|
||||||
|
<!-- VUE_CORE_SIZE -->
|
||||||
|
body-include: '<!-- VUE_CORE_SIZE -->'
|
||||||
|
|
Loading…
Reference in New Issue