Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This action did not correctly update the comment with the lockfile changes if it was run with a custom token (e.g. not the default github action token).
Finding the comment made by the action matched the first line of the comment (comment header) and checked that the comment author had the login
github-action[bot]
. If this action is called with a customtoken
as input, then the comment is created by the user that owns the custom token (e.g. a Github App), so it did not find the existing comment and instead created a new comment.This PR changes how an existing comment to update is found. It adds some hidden metadata to the comment (
<!-- npm-lockfile-changes-action comment -->
) and uses that to find an existing comment.I looked into somehow matching the login name of the token owner to the comment author login, but I could not figure out the token permissions needed to read this data, and this seemed to add complexity. Using the hidden comment identifier seems to a robust solution which is fairly simple, and does not require the token to have any permissions other than PR write.