From: Evan You Date: Thu, 8 Aug 2024 10:06:32 +0000 (+0800) Subject: workflow: fix size report base branch X-Git-Tag: v3.4.37~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32a1433e0debd538c199bde18390bb903b4cde5a;p=thirdparty%2Fvuejs%2Fcore.git workflow: fix size report base branch --- diff --git a/.github/workflows/size-data.yml b/.github/workflows/size-data.yml index 664f75aeec..f73a59607a 100644 --- a/.github/workflows/size-data.yml +++ b/.github/workflows/size-data.yml @@ -43,12 +43,16 @@ jobs: name: size-data path: temp/size - - name: Save PR number + - name: Save PR number & base branch if: ${{github.event_name == 'pull_request'}} - run: echo ${{ github.event.number }} > ./pr.txt + run: | + echo ${{ github.event.number }} > ./number.txt + echo ${{ github.base_ref }} > ./base.txt - uses: actions/upload-artifact@v4 if: ${{github.event_name == 'pull_request'}} with: - name: pr-number - path: pr.txt + name: pr-info + path: | + number.txt + base.txt diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml index 25c93d8ed0..c8258f8b92 100644 --- a/.github/workflows/size-report.yml +++ b/.github/workflows/size-report.yml @@ -35,18 +35,24 @@ jobs: - name: Install dependencies run: pnpm install - - name: Download PR number + - name: Download PR info uses: dawidd6/action-download-artifact@v6 with: - name: pr-number + name: pr-info run_id: ${{ github.event.workflow_run.id }} - path: /tmp/pr-number + path: /tmp/pr-info - name: Read PR Number id: pr-number uses: juliangruber/read-file-action@v1 with: - path: /tmp/pr-number/pr.txt + path: /tmp/pr-info/number.txt + + - name: Read PR base branch + id: pr-base + uses: juliangruber/read-file-action@v1 + with: + path: /tmp/pr-info/base.txt - name: Download Size Data uses: dawidd6/action-download-artifact@v6 @@ -58,7 +64,7 @@ jobs: - name: Download Previous Size Data uses: dawidd6/action-download-artifact@v6 with: - branch: ${{ github.base_ref }} + branch: ${{ steps.pr-base.outputs.content }} workflow: size-data.yml event: push name: size-data