Giter Site home page Giter Site logo

Comments (4)

polarathene avatar polarathene commented on June 15, 2024

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.

from action-netlify-deploy.

South-Paw avatar South-Paw commented on June 15, 2024

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.

Goal was to hide old comments and add new ones as to retain a history of builds for a commit/pr

This also seems to be what the official netlify bot does?

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 😄

nwtgck/actions-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

from action-netlify-deploy.

polarathene avatar polarathene commented on June 15, 2024

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 :)

from action-netlify-deploy.

South-Paw avatar South-Paw commented on June 15, 2024

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.

from action-netlify-deploy.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.