event-app: integrate Community Hubs functionality #1544
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
| name: Hide canceled Netlify deploy preview comments | |
| # Netlify posts one comment per site and edits it in place as the deploy | |
| # progresses (processing -> canceled/ready), so the "canceled" text only ever | |
| # shows up via an `edited` event, never the initial `created` one. | |
| # This just collapses that specific comment after the fact — it never touches | |
| # Netlify, builds, or deploys, and only reacts to a comment already posted. | |
| on: | |
| issue_comment: | |
| types: [edited] | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| hide-comment: | |
| if: > | |
| github.event.issue.pull_request != null && | |
| github.event.comment.user.login == 'netlify[bot]' && | |
| contains(github.event.comment.body, 'Deploy Preview for') && | |
| (contains(github.event.comment.body, 'canceled') || contains(github.event.comment.body, 'cancelled')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Minimize comment as outdated | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.graphql( | |
| `mutation($id: ID!) { | |
| minimizeComment(input: { subjectId: $id, classifier: OUTDATED }) { | |
| clientMutationId | |
| } | |
| }`, | |
| { id: context.payload.comment.node_id } | |
| ) |