Skip to content

Commit 9a3473a

Browse files
authored
Merge cc0e2cc into 7da9af9
2 parents 7da9af9 + cc0e2cc commit 9a3473a

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nextjs-bundle-analysis': patch
3+
---
4+
5+
Update template to use [sticky-pull-request-comment](https://github.com/marocchino/sticky-pull-request-comment)

compare.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,6 @@ if (hasNoChanges) {
192192
output += 'This PR introduced no changes to the JavaScript bundle! 🙌'
193193
}
194194

195-
// we add this tag so that our action can be able to easily and consistently find the
196-
// right comment to edit as more commits are pushed.
197-
output += `<!-- __NEXTJS_BUNDLE_${PACKAGE_NAME} -->`
198-
199195
// however, if ignoreIfEmpty is true, set output to an empty string
200196
if (hasNoChanges && SKIP_COMMENT_IF_EMPTY) {
201197
output = ''

template.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,8 @@ jobs:
104104
echo "$(cat .next/analyze/__bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT
105105
echo EOF >> $GITHUB_OUTPUT
106106
107-
- name: Find Comment
108-
uses: peter-evans/find-comment@v2
109-
if: success() && github.event.number
110-
id: fc
111-
with:
112-
issue-number: ${{ github.event.number }}
113-
body-includes: '<!-- __NEXTJS_BUNDLE -->'
114-
115-
- name: Create Comment
116-
uses: peter-evans/create-or-update-comment@v2
117-
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
118-
with:
119-
issue-number: ${{ github.event.number }}
120-
body: ${{ steps.get-comment-body.outputs.body }}
121-
122-
- name: Update Comment
123-
uses: peter-evans/create-or-update-comment@v2
124-
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
107+
- name: Comment
108+
uses: marocchino/sticky-pull-request-comment@v2
125109
with:
126-
issue-number: ${{ github.event.number }}
127-
body: ${{ steps.get-comment-body.outputs.body }}
128-
comment-id: ${{ steps.fc.outputs.comment-id }}
129-
edit-mode: replace
110+
header: next-touched-pages
111+
message: ${{ steps.get-comment-body.outputs.body }}

0 commit comments

Comments
 (0)