diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml index 87c6865927b..4b386424697 100644 --- a/.github/workflows/size-report.yml +++ b/.github/workflows/size-report.yml @@ -1,13 +1,15 @@ name: size report on: + push: + branches: + - main pull_request: branches: - main permissions: contents: read - pull-requests: write jobs: size: @@ -31,6 +33,7 @@ jobs: - name: Download Previous Size Report id: download-artifact uses: dawidd6/action-download-artifact@v2 + if: ${{github.event_name == 'pull_request'}} with: branch: main name: size-report @@ -45,16 +48,20 @@ jobs: - name: Compare size run: pnpm tsx scripts/size-report.ts > size.md + if: ${{github.event_name == 'pull_request'}} - name: Read Size Markdown id: size-markdown uses: juliangruber/read-file-action@v1 + if: ${{github.event_name == 'pull_request'}} with: path: ./size.md - name: Create Comment uses: actions-cool/maintain-one-comment@v3 + if: ${{github.event_name == 'pull_request'}} with: + token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }} body: | ${{steps.size-markdown.outputs.content}}