size-report.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: size report
  2. on:
  3. workflow_run:
  4. workflows: ['size data']
  5. types:
  6. - completed
  7. permissions:
  8. contents: read
  9. pull-requests: write
  10. issues: write
  11. env:
  12. PUPPETEER_SKIP_DOWNLOAD: 'true'
  13. jobs:
  14. size-report:
  15. runs-on: ubuntu-latest
  16. if: >
  17. github.event.workflow_run.event == 'pull_request' &&
  18. github.event.workflow_run.conclusion == 'success'
  19. steps:
  20. - uses: actions/checkout@v4
  21. - name: Install pnpm
  22. uses: pnpm/action-setup@v4.0.0
  23. - name: Install Node.js
  24. uses: actions/setup-node@v4
  25. with:
  26. node-version-file: '.node-version'
  27. cache: pnpm
  28. - name: Install dependencies
  29. run: pnpm install
  30. - name: Download Size Data
  31. uses: dawidd6/action-download-artifact@v4
  32. with:
  33. name: size-data
  34. run_id: ${{ github.event.workflow_run.id }}
  35. path: temp/size
  36. - name: Download Previous Size Data
  37. uses: dawidd6/action-download-artifact@v4
  38. with:
  39. branch: main
  40. workflow: size-data.yml
  41. event: push
  42. name: size-data
  43. path: temp/size-prev
  44. if_no_artifact_found: warn
  45. - name: Prepare report
  46. run: pnpm tsx scripts/size-report.ts > size-report.md
  47. - name: Create Comment
  48. uses: thollander/actions-comment-pull-request@v2.5.0
  49. with:
  50. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  51. filePath: size-report.md
  52. pr_number: ${{ github.event.workflow_run.pull_requests[0].number }}
  53. comment_tag: VUE_CORE_SIZE