Truncate long comment bodies during comment update too#205
Merged
peter-evans merged 2 commits intopeter-evans:mainfrom Jun 8, 2023
Dermah:patch-1
Merged
Truncate long comment bodies during comment update too#205peter-evans merged 2 commits intopeter-evans:mainfrom Dermah:patch-1
peter-evans merged 2 commits intopeter-evans:mainfrom
Dermah:patch-1
Conversation
peter-evans
requested changes
Jun 7, 2023
Owner
There was a problem hiding this comment.
Thank you for raising this issue and contributing! It was just an oversight on my part that the original fix didn't cover update, too.
I left a comment to simply the fix slightly. I think we can just move the original code block a bit earlier in the stack so it handles both cases.
peter-evans
approved these changes
Jun 8, 2023
Owner
|
Thank you! |
Owner
|
Released as |
Brooooooklyn
referenced
this pull request
in rolldown/rolldown
Mar 9, 2024
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [peter-evans/create-or-update-comment](https://togithub.com/peter-evans/create-or-update-comment) | action | major | `v1.4.5` -> `v4.0.0` | --- ### Release Notes <details> <summary>peter-evans/create-or-update-comment (peter-evans/create-or-update-comment)</summary> ### [`v4.0.0`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v4.0.0): Create or Update Comment v4.0.0 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v3.1.0...v4.0.0) ⚙️ Updated runtime to Node.js 20 - The action now requires a minimum version of [v2.308.0](https://togithub.com/actions/runner/releases/tag/v2.308.0) for the Actions runner. Update self-hosted runners to v2.308.0 or later to ensure compatibility. #### What's Changed - build(deps): bump actions/setup-node from 3 to 4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/273](https://togithub.com/peter-evans/create-or-update-comment/pull/273) - build(deps-dev): bump [@​vercel/ncc](https://togithub.com/vercel/ncc) from 0.38.0 to 0.38.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/274](https://togithub.com/peter-evans/create-or-update-comment/pull/274) - build(deps-dev): bump eslint-plugin-jest from 27.4.2 to 27.4.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/276](https://togithub.com/peter-evans/create-or-update-comment/pull/276) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.18.5 to 18.18.6 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/277](https://togithub.com/peter-evans/create-or-update-comment/pull/277) - build(deps-dev): bump eslint from 8.51.0 to 8.52.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/275](https://togithub.com/peter-evans/create-or-update-comment/pull/275) - build(deps-dev): bump eslint-plugin-jest from 27.4.3 to 27.6.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/278](https://togithub.com/peter-evans/create-or-update-comment/pull/278) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.18.6 to 18.18.8 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/279](https://togithub.com/peter-evans/create-or-update-comment/pull/279) - build(deps-dev): bump eslint from 8.52.0 to 8.53.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/280](https://togithub.com/peter-evans/create-or-update-comment/pull/280) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.18.8 to 18.18.9 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/281](https://togithub.com/peter-evans/create-or-update-comment/pull/281) - build(deps-dev): bump prettier from 3.0.3 to 3.1.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/282](https://togithub.com/peter-evans/create-or-update-comment/pull/282) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.18.9 to 18.18.12 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/283](https://togithub.com/peter-evans/create-or-update-comment/pull/283) - build(deps-dev): bump eslint from 8.53.0 to 8.54.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/284](https://togithub.com/peter-evans/create-or-update-comment/pull/284) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.18.12 to 18.18.13 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/285](https://togithub.com/peter-evans/create-or-update-comment/pull/285) - build(deps-dev): bump eslint from 8.54.0 to 8.55.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/286](https://togithub.com/peter-evans/create-or-update-comment/pull/286) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.18.13 to 18.19.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/287](https://togithub.com/peter-evans/create-or-update-comment/pull/287) - build(deps): bump chuhlomin/render-template from 1.8 to 1.9 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/288](https://togithub.com/peter-evans/create-or-update-comment/pull/288) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.19.2 to 18.19.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/289](https://togithub.com/peter-evans/create-or-update-comment/pull/289) - build(deps-dev): bump prettier from 3.1.0 to 3.1.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/290](https://togithub.com/peter-evans/create-or-update-comment/pull/290) - build(deps-dev): bump eslint-plugin-prettier from 5.0.1 to 5.1.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/292](https://togithub.com/peter-evans/create-or-update-comment/pull/292) - build(deps-dev): bump eslint from 8.55.0 to 8.56.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/293](https://togithub.com/peter-evans/create-or-update-comment/pull/293) - build(deps): bump actions/download-artifact from 3 to 4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/295](https://togithub.com/peter-evans/create-or-update-comment/pull/295) - build(deps-dev): bump eslint-plugin-prettier from 5.1.0 to 5.1.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/296](https://togithub.com/peter-evans/create-or-update-comment/pull/296) - build(deps-dev): bump eslint-plugin-jest from 27.6.0 to 27.6.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/297](https://togithub.com/peter-evans/create-or-update-comment/pull/297) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.19.3 to 18.19.4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/298](https://togithub.com/peter-evans/create-or-update-comment/pull/298) - build(deps-dev): bump eslint-plugin-prettier from 5.1.2 to 5.1.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/299](https://togithub.com/peter-evans/create-or-update-comment/pull/299) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.19.4 to 18.19.6 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/300](https://togithub.com/peter-evans/create-or-update-comment/pull/300) - build(deps-dev): bump prettier from 3.1.1 to 3.2.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/301](https://togithub.com/peter-evans/create-or-update-comment/pull/301) - build(deps-dev): bump eslint-plugin-jest from 27.6.1 to 27.6.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/302](https://togithub.com/peter-evans/create-or-update-comment/pull/302) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.19.6 to 18.19.7 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/303](https://togithub.com/peter-evans/create-or-update-comment/pull/303) - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.19.7 to 18.19.8 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/304](https://togithub.com/peter-evans/create-or-update-comment/pull/304) - build(deps-dev): bump prettier from 3.2.3 to 3.2.4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/305](https://togithub.com/peter-evans/create-or-update-comment/pull/305) - feat: update runtime to node 20 by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/306](https://togithub.com/peter-evans/create-or-update-comment/pull/306) **Full Changelog**: peter-evans/create-or-update-comment@v3.1.0...v4.0.0 ### [`v3.1.0`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v3.1.0): Create or Update Comment v3.1.0 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v3.0.2...v3.1.0) #### What's Changed - Add truncate warning to body of comment by [@​ethanmdavidson](https://togithub.com/ethanmdavidson) and [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/272](https://togithub.com/peter-evans/create-or-update-comment/pull/272) - 46 dependency updates by [@​dependabot](https://togithub.com/dependabot) **Full Changelog**: peter-evans/create-or-update-comment@v3.0.2...v3.1.0 ### [`v3.0.2`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v3.0.2): Create or Update Comment v3.0.2 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v3.0.1...v3.0.2) #### What's Changed - Truncate long comment bodies during comment update too by [@​Dermah](https://togithub.com/Dermah) in [https://github.com/peter-evans/create-or-update-comment/pull/205](https://togithub.com/peter-evans/create-or-update-comment/pull/205) - Update distribution by [@​actions-bot](https://togithub.com/actions-bot) in [https://github.com/peter-evans/create-or-update-comment/pull/210](https://togithub.com/peter-evans/create-or-update-comment/pull/210) - 23 dependency updates by [@​dependabot](https://togithub.com/dependabot) #### New Contributors - [@​Dermah](https://togithub.com/Dermah) made their first contribution in [https://github.com/peter-evans/create-or-update-comment/pull/205](https://togithub.com/peter-evans/create-or-update-comment/pull/205) **Full Changelog**: peter-evans/create-or-update-comment@v3.0.1...v3.0.2 ### [`v3.0.1`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v3.0.1): Create or Update Comment v3.0.1 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v3.0.0...v3.0.1) #### What's Changed - fix: find-comment version by [@​ematipico](https://togithub.com/ematipico) in [https://github.com/peter-evans/create-or-update-comment/pull/164](https://togithub.com/peter-evans/create-or-update-comment/pull/164) - fix: truncate body when it exceeds the max length by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/182](https://togithub.com/peter-evans/create-or-update-comment/pull/182) - 12 dependency updates by [@​dependabot](https://togithub.com/dependabot) #### New Contributors - [@​ematipico](https://togithub.com/ematipico) made their first contribution in [https://github.com/peter-evans/create-or-update-comment/pull/164](https://togithub.com/peter-evans/create-or-update-comment/pull/164) **Full Changelog**: peter-evans/create-or-update-comment@v3.0.0...v3.0.1 ### [`v3.0.0`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v3.0.0): Create or Update Comment v3.0.0 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v2.1.1...v3.0.0) #### What's new - Now supports replacing reactions on a comment by setting input `reactions-edit-mode` to `replace`. The default behaviour has not changed and will `append` reactions. - Chose how the action should append the comment body with input `append-separator`. The default behaviour is to add a `newline`. Other options are `space` and `none`. - `body-file` is deprecated in favour of `body-path`. The behaviour is unchanged. #### What's Changed - v3 by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/161](https://togithub.com/peter-evans/create-or-update-comment/pull/161) - Update some links in the README by [@​Kurt-von-Laven](https://togithub.com/Kurt-von-Laven) in [https://github.com/peter-evans/create-or-update-comment/pull/152](https://togithub.com/peter-evans/create-or-update-comment/pull/152) - 9 dependency updates by [@​dependabot](https://togithub.com/dependabot) #### New Contributors - [@​Kurt-von-Laven](https://togithub.com/Kurt-von-Laven) made their first contribution in [https://github.com/peter-evans/create-or-update-comment/pull/152](https://togithub.com/peter-evans/create-or-update-comment/pull/152) **Full Changelog**: peter-evans/create-or-update-comment@v2.1.1...v3.0.0 ### [`v2.1.1`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v2.1.1): Create or Update Comment v2.1.1 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v2.1.0...v2.1.1) ⚙️ Fixes the recent Json5 vulnerability. #### What's Changed - 11 dependency updates by [@​dependabot](https://togithub.com/dependabot) **Full Changelog**: peter-evans/create-or-update-comment@v2.1.0...v2.1.1 ### [`v2.1.0`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v2.1.0): Create or Update Comment v2.1.0 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v2.0.1...v2.1.0) ⭐ Adds input `body-file`, the path to a file containing the comment body. #### What's Changed - Replace set-output by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/130](https://togithub.com/peter-evans/create-or-update-comment/pull/130) - Bump chuhlomin/render-template from 1.5 to 1.6 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/peter-evans/create-or-update-comment/pull/132](https://togithub.com/peter-evans/create-or-update-comment/pull/132) - Support reading body from a file by [@​umanghome](https://togithub.com/umanghome) in [https://github.com/peter-evans/create-or-update-comment/pull/115](https://togithub.com/peter-evans/create-or-update-comment/pull/115) - Add input body-file by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/133](https://togithub.com/peter-evans/create-or-update-comment/pull/133) #### New Contributors - [@​umanghome](https://togithub.com/umanghome) made their first contribution in [https://github.com/peter-evans/create-or-update-comment/pull/115](https://togithub.com/peter-evans/create-or-update-comment/pull/115) **Full Changelog**: peter-evans/create-or-update-comment@v2.0.1...v2.1.0 ### [`v2.0.1`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v2.0.1): Create or Update Comment v2.0.1 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v2.0.0...v2.0.1) ⚙️ Bumps `@actions/core` to transition away from [deprecated runner commands](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/). #### What's Changed - Add workflow permissions by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/120](https://togithub.com/peter-evans/create-or-update-comment/pull/120) - 9 dependency updates by [@​github-actions](https://togithub.com/github-actions) and https://github.com/dependabot **Full Changelog**: peter-evans/create-or-update-comment@v2.0.0...v2.0.1 ### [`v2.0.0`](https://togithub.com/peter-evans/create-or-update-comment/releases/tag/v2.0.0): Create or Update Comment v2.0.0 [Compare Source](https://togithub.com/peter-evans/create-or-update-comment/compare/v1.4.5...v2.0.0) #### What's new - Updated runtime to Node.js 16 - The action now requires a minimum version of v2.285.0 for the [Actions Runner](https://togithub.com/actions/runner/releases/tag/v2.285.0). - If using GitHub Enterprise Server, the action requires [GHES 3.4](https://docs.github.com/en/enterprise-server@3.4/admin/release-notes) or later. #### What's Changed - Use double quotes to preserve adjacent spaces correctly by [@​mfn](https://togithub.com/mfn) in [https://github.com/peter-evans/create-or-update-comment/pull/95](https://togithub.com/peter-evans/create-or-update-comment/pull/95) - Remove workflow by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/101](https://togithub.com/peter-evans/create-or-update-comment/pull/101) - Update runtime to node 16 by [@​peter-evans](https://togithub.com/peter-evans) in [https://github.com/peter-evans/create-or-update-comment/pull/105](https://togithub.com/peter-evans/create-or-update-comment/pull/105) - 7 dependency updates by [@​actions-bot](https://togithub.com/actions-bot) and [@​dependabot](https://togithub.com/dependabot) #### New Contributors - [@​mfn](https://togithub.com/mfn) made their first contribution in [https://github.com/peter-evans/create-or-update-comment/pull/95](https://togithub.com/peter-evans/create-or-update-comment/pull/95) **Full Changelog**: peter-evans/create-or-update-comment@v1.4.5...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/rolldown-rs/rolldown). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMzAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIzMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#182 truncated comment bodies during comment creation only. But it doesn't truncate comment bodies during update.
This fix also truncates comment update bodies that are too long (in both the replace and append cases)
I'm working on a private project that uses this action, it fails to update a comment because the update body is too long. This PR is an extremely crap proof of concept that has unblocked my project.
I realise it might be a bad developer experience to silently drop text that someone is trying to append to a comment.