size-report.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.repository == 'vuejs/core' &&
  18. github.event.workflow_run.event == 'pull_request' &&
  19. github.event.workflow_run.conclusion == 'success'
  20. steps:
  21. - uses: actions/checkout@v6
  22. - name: Setup Vite+
  23. uses: voidzero-dev/setup-vp@v1
  24. with:
  25. node-version-file: '.node-version'
  26. cache: true
  27. - name: Download Size Data
  28. uses: dawidd6/action-download-artifact@v19
  29. with:
  30. name: size-data
  31. run_id: ${{ github.event.workflow_run.id }}
  32. path: temp/size
  33. - name: Read PR Number
  34. id: pr-number
  35. uses: juliangruber/read-file-action@v1
  36. with:
  37. path: temp/size/number.txt
  38. - name: Read base branch
  39. id: pr-base
  40. uses: juliangruber/read-file-action@v1
  41. with:
  42. path: temp/size/base.txt
  43. - name: Download Previous Size Data
  44. uses: dawidd6/action-download-artifact@v19
  45. with:
  46. branch: ${{ steps.pr-base.outputs.content }}
  47. workflow: size-data.yml
  48. event: push
  49. name: size-data
  50. path: temp/size-prev
  51. if_no_artifact_found: warn
  52. - name: Prepare report
  53. run: node scripts/size-report.js > size-report.md
  54. - name: Read Size Report
  55. id: size-report
  56. uses: juliangruber/read-file-action@v1
  57. with:
  58. path: ./size-report.md
  59. - name: Create Comment
  60. uses: actions-cool/maintain-one-comment@v3
  61. with:
  62. token: ${{ secrets.GITHUB_TOKEN }}
  63. number: ${{ steps.pr-number.outputs.content }}
  64. body: |
  65. ${{ steps.size-report.outputs.content }}
  66. <!-- VUE_CORE_SIZE -->
  67. body-include: '<!-- VUE_CORE_SIZE -->'