Skip to content

Conversation

@awxiaoxian2020
Copy link
Contributor

close #5801.

It works fine in zh-hans repo workflow.

I will explain my changes in code review.

@github-actions
Copy link

github-actions bot commented Apr 1, 2023

Size changes

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

This PR introduced no changes to the javascript bundle 🙌

with:
workflow: analyze.yml
branch: ${{ github.event.pull_request.base.ref }}
branch: ${{ github.event.pull_request.base.ref || 'main' }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we push directly, we use main branch.

name: analysis_comment.txt
path: .next/analyze/__bundle_analysis_comment.txt

number:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't upload the pr_number when we push directly. So I split a new job and add a condition in order to run it on pull_request only.

if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
github.event.workflow_run.workflows.event_name == 'pull_request' && github.event.workflow_run.workflows.conclusion == 'success'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the key about this problem.

We should use github.event.workflow_run.workflows.event_name instead of github.event.workflow_run.event.

And we shouldn't use the ${{}}, I think.

@awxiaoxian2020 awxiaoxian2020 deleted the gh-workflow branch April 2, 2023 01:53
@awxiaoxian2020 awxiaoxian2020 restored the gh-workflow branch August 17, 2025 07:29
@awxiaoxian2020 awxiaoxian2020 deleted the gh-workflow branch August 17, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GH workflow] update analyze.yml to avoid noisy notification

2 participants