-
Notifications
You must be signed in to change notification settings - Fork 9
Minimize outdated deploy comments on new build #6
Comments
You may want to look at this Vercel action: https://github.com/marketplace/actions/vercel-action Which checks for an existing preview deploy comment on a PR from the action, and edits it for future builds instead of adding new comments. This also seems to be what the official netlify bot does? (I haven't confirmed if they're using an action for their preview deploy, or just default integration with netlify): facebook/docusaurus#4409 (comment) EDIT: I'm using this action which is for Netlify, you can see how they approach the comment management here. However, their comment isn't customizable, so I actually disabled it and use the deploy preview URL output from the action to get the same functionality with a separate action: - uses: marocchino/sticky-pull-request-comment@v2
with:
header: preview
message: |
[Documentation preview for this PR](${{ steps.preview.outputs.deploy-url }}) is ready! :tada:
Built with commit ${{ github.event.pull_request.head.sha }} You may just want to take that route and advise users to add an action like that if they need more flexibility beyond whatever your action will support for comments. |
Goal was to hide old comments and add new ones as to retain a history of builds for a commit/pr
This action serves a different purpose than the Netlify GitHub app - if I wanted to use the official bot I wouldn't have written an action to deploy to Netlify 😄 Yes, it makes use of what is already noted in the issue above - ie; by adding an identifier to each comment NB: v1.2.0 of this action added support for GitHub environments which, if used, resolves the issue of having PRs with multiple comments on it as well as providing a history of deployments for each environment via GitHub's own UI. If you want to configure this, see the action.yml here for the action inputs |
Comment history retains prior build history without littering comments and hiding outdated ones. I don't see how multiple comments with hiding is a better approach? I use an action to deploy to Netlify build output from the github CI, and only for deploy previews, production deploy is to github pages. Yet having a comment similar to the netlify bot and updating that comment is what I wanted still. I use a separate comment update action which formats the comment how I want with a link to the preview build and any other info. That action has a prop for a unique ID to associate to it, so that you can have multiple comments that are for distinctly separate things, be that more than one netlify build involved or separate services / reports, etc. Apologies if you had meant for something else, I just noticed the issue and figured I'd mention what I'd seen elsewhere if it'd have helped :) |
If you wanted any of these use cases as features then please realize that your first comment did not communicate that at all. You did not ask for anything and just made "suggestions" on where to look for code or examples. |
Description
When the Github action is going to comment on a new PR, it would be nice to see it check if there are any other deploy comments for the same Netlify Site ID and if they are older than the current one the action should minimize those comments and mark them as outdated.
Notes:
<!-- -->
) such as the time of build and the Netlify Site ID so that the action can compare comments easily.minimizeComment
The text was updated successfully, but these errors were encountered: