From 39d4fc1374d7bf01921116ca73f55e5a282a5f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Mon, 21 Aug 2023 11:44:43 +0800 Subject: [PATCH] ci: fix size report permissions --- .github/workflows/size-report.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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}}