diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 2f3c65ea07..83e7f2e8a9 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -7,23 +7,9 @@ on: - main # change this if your default branch is named differently workflow_dispatch: - permissions: {} +permissions: {} jobs: - event_type: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Save Event Type - run: echo ${{ github.event_name }} > ./event_type - - - name: Upload Event Type - uses: actions/upload-artifact@v4 - with: - path: ./event_type - name: event_type - analyze: runs-on: ubuntu-latest steps: @@ -75,7 +61,7 @@ jobs: if: success() && github.event.number with: workflow: analyze.yml - branch: ${{ github.event.pull_request.base.ref || 'main' }} + branch: ${{ github.event.pull_request.base.ref }} name: bundle_analysis.json path: .next/analyze/base/bundle @@ -93,7 +79,7 @@ jobs: # Either of these arguments can be changed or removed by editing the `nextBundleAnalysis` # entry in your package.json file. - name: Compare with base branch bundle - if: success() + if: success() && github.event.number run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare - name: Upload analysis comment @@ -102,13 +88,6 @@ jobs: name: analysis_comment.txt path: .next/analyze/__bundle_analysis_comment.txt - number: - runs-on: ubuntu-latest - needs: analyze - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v3 - - name: Save PR number run: echo ${{ github.event.number }} > ./pr_number diff --git a/.github/workflows/analyze_comment.yml b/.github/workflows/analyze_comment.yml index 85e9d69181..fcac377386 100644 --- a/.github/workflows/analyze_comment.yml +++ b/.github/workflows/analyze_comment.yml @@ -14,23 +14,11 @@ permissions: jobs: comment: runs-on: ubuntu-latest + if: > + ${{ github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' }} steps: - - name: Download Event Type - uses: dawidd6/action-download-artifact@v3 - with: - workflow: analyze.yml - run_id: ${{ github.event.workflow_run.id }} - name: event_type - path: event_type - - - name: get type - id: get-type - run: | - event_type=$(cat event_type/event_type) - echo "event-type=$event_type" >> $GITHUB_OUTPUT - - name: Download base branch bundle stats - if: github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request' uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e with: workflow: analyze.yml @@ -39,7 +27,6 @@ jobs: path: analysis_comment.txt - name: Download PR number - if: github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request' uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e with: workflow: analyze.yml @@ -49,7 +36,7 @@ jobs: - name: Get comment body id: get-comment-body - if: success() && github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request' + if: success() run: | echo 'body<> $GITHUB_OUTPUT echo '' >> $GITHUB_OUTPUT diff --git a/src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md b/src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md index 864160a616..70b580afad 100644 --- a/src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md +++ b/src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md @@ -81,7 +81,7 @@ React 服务器组件、资源加载、文档元数据与 Action 都已经加入 - **资源加载**:我们将 Suspense 与样式表、字体和脚本等资源的加载生命周期集成在一起,以便 React 考虑它们来确定像 [`