Skip to content

Commit 609533c

Browse files
authored
Make bundle analysis workflow less fragile (#5971)
* Make bundle analysis workflow less fragile * Use sticky comment action
1 parent dc1d580 commit 609533c

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

.github/workflows/analyze.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
# Here's the first place where next-bundle-analysis' own script is used
3939
# This step pulls the raw bundle stats for the current bundle
4040
- name: Analyze bundle
41-
run: npx -p nextjs-bundle-analysis report
41+
run: npx -p nextjs-bundle-analysis@0.5.0 report
4242

4343
- name: Upload bundle
4444
uses: actions/upload-artifact@v2

.github/workflows/analyze_comment.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,8 @@ jobs:
4747
pr_number=$(cat pr_number/pr_number)
4848
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
4949
50-
- name: Find Comment
51-
uses: peter-evans/find-comment@v1
52-
if: success()
53-
id: fc
54-
with:
55-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
56-
body-includes: "<!-- __NEXTJS_BUNDLE -->"
57-
58-
- name: Create Comment
59-
uses: peter-evans/[email protected]
60-
if: success() && steps.fc.outputs.comment-id == 0
61-
with:
62-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
63-
body: ${{ steps.get-comment-body.outputs.body }}
64-
65-
- name: Update Comment
66-
uses: peter-evans/[email protected]
67-
if: success() && steps.fc.outputs.comment-id != 0
50+
- name: Comment
51+
uses: marocchino/sticky-pull-request-comment@v2
6852
with:
69-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
70-
body: ${{ steps.get-comment-body.outputs.body }}
71-
comment-id: ${{ steps.fc.outputs.comment-id }}
72-
edit-mode: replace
53+
header: next-bundle-analysis
54+
message: ${{ steps.get-comment-body.outputs.body }}

0 commit comments

Comments
 (0)