Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update comment not working, PR gets multiple comments #57

Open
ethanryan opened this issue Apr 21, 2023 · 2 comments
Open

update comment not working, PR gets multiple comments #57

ethanryan opened this issue Apr 21, 2023 · 2 comments
Labels
question Further information is requested

Comments

@ethanryan
Copy link

ethanryan commented Apr 21, 2023

update comment is not working, example:

update-comment-not-working

this is causing multiple comments to appear with each new commit, instead of new commits replacing old comments.

Our PRs are getting multiple comments from nextjs-bundle-analysis github action. We get a comment when opening a new PR, and then a new comment on each new commit pushed.

For example:

next-analysis-multiple-comments

Previously, the comment would be replaced with each new commit.

We have other github actions that do not have this problem.

Any help would be greatly appreciated. Thanks!

(closed related issue, for multiple comments: #56)

@ethanryan
Copy link
Author

fixed this issue with solution offered in this closed issue: #52 (comment)

You can upgrade right now by replacing the Find, Create, and Update steps with the following:

- name: Comment
  uses: marocchino/sticky-pull-request-comment@v2
  with:
    header: next-touched-pages
    message: ${{ steps.get-comment-body.outputs.body }}

may be helpful to keep this issue open for others facing this problem, until this PR fixing the issue is merged: #54

@ethanryan ethanryan changed the title update comment not working update comment not working, PR gets multiple comments instead of comment being updated Apr 23, 2023
@ethanryan ethanryan changed the title update comment not working, PR gets multiple comments instead of comment being updated update comment not working, PR gets multiple comments Apr 23, 2023
@BRKalow BRKalow added the question Further information is requested label Apr 24, 2023
@isBatak
Copy link

isBatak commented Aug 7, 2023

@ethanryan you can just update this line

body-includes: '<!-- __NEXTJS_BUNDLE -->'
and append you project name form package.json prefixed with _
For example:

// package.json
{
	"name": "my-app",
	...
}
      - name: Find Comment
        uses: peter-evans/find-comment@v2
        if: success() && github.event.number
        id: fc
        with:
          issue-number: ${{ github.event.number }}
          body-includes: '<!-- __NEXTJS_BUNDLE_my-app -->'

e.g. '<!-- __NEXTJS_BUNDLE_${PROJECT_NAME} -->'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants