{"id":24224573,"url":"https://github.com/edumserrano/find-create-or-update-comment","last_synced_at":"2025-07-30T13:33:20.675Z","repository":{"id":49782417,"uuid":"512301390","full_name":"edumserrano/find-create-or-update-comment","owner":"edumserrano","description":"A composite GitHub action that can be used to create or update a GitHub issue/pull request comment.","archived":false,"fork":false,"pushed_at":"2025-05-25T23:27:52.000Z","size":69,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-25T09:53:58.197Z","etag":null,"topics":["comment","create-comment","find-comment","github","github-action","github-actions","issue","pull-request","update-comment"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edumserrano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"edumserrano"}},"created_at":"2022-07-09T22:59:38.000Z","updated_at":"2025-05-25T23:27:56.000Z","dependencies_parsed_at":"2024-02-10T05:19:49.280Z","dependency_job_id":"b994eb9b-22aa-4a5d-9f9d-1b7ce96c41a9","html_url":"https://github.com/edumserrano/find-create-or-update-comment","commit_stats":{"total_commits":19,"total_committers":3,"mean_commits":6.333333333333333,"dds":"0.21052631578947367","last_synced_commit":"7cdd602f50517b3dcc10b798aa009e5cf520ffd8"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/edumserrano/find-create-or-update-comment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edumserrano%2Ffind-create-or-update-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edumserrano%2Ffind-create-or-update-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edumserrano%2Ffind-create-or-update-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edumserrano%2Ffind-create-or-update-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edumserrano","download_url":"https://codeload.github.com/edumserrano/find-create-or-update-comment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edumserrano%2Ffind-create-or-update-comment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267875623,"owners_count":24158781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comment","create-comment","find-comment","github","github-action","github-actions","issue","pull-request","update-comment"],"created_at":"2025-01-14T07:17:47.146Z","updated_at":"2025-07-30T13:33:20.650Z","avatar_url":"https://github.com/edumserrano.png","language":null,"funding_links":["https://github.com/sponsors/edumserrano"],"categories":[],"sub_categories":[],"readme":"# Find, create or update comment GitHub action\n\n[![Test GitHub action](https://github.com/edumserrano/find-create-or-update-comment/actions/workflows/test-action.yml/badge.svg)](https://github.com/edumserrano/find-create-or-update-comment/actions/workflows/test-action.yml)\n[![Test GitHub action from GH Marketplace](https://github.com/edumserrano/find-create-or-update-comment/actions/workflows/test-action-gh-marketplace.yml/badge.svg)](https://github.com/edumserrano/find-create-or-update-comment/actions/workflows/test-action-gh-marketplace.yml)\n[![Markdown link check](https://github.com/edumserrano/find-create-or-update-comment/actions/workflows/markdown-link-check.yml/badge.svg)](https://github.com/edumserrano/find-create-or-update-comment/actions/workflows/markdown-link-check.yml)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Find,%20create%20or%20update%20comment-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/find-create-or-update-comment)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/edumserrano)](https://github.com/sponsors/edumserrano)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-Eduardo%20Serrano-blue.svg)](https://www.linkedin.com/in/eduardomserrano/)\n\n- [Description](#description)\n- [Why should you use this action ?](#why-should-you-use-this-action-)\n- [Usage](#usage)\n- [Action inputs](#action-inputs)\n- [Dev notes](#dev-notes)\n\n## Description\n\nA composite [GitHub action](https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions) that can be used to find a GitHub Issue or Pull Request comment by a specified value and then update the comment if found or create it if not found.\n\n## Why should you use this action ?\n\nThis is nothing more than a combination of the awesome work done by [Peter Evans](https://github.com/peter-evans). I'm combining the [find-comment](https://github.com/peter-evans/find-comment) and the [create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) because I found that I end up using those actions together a lot of the time.\n\nThis is a implementation of what is described in [the docs for create-or-update-comment](https://github.com/peter-evans/create-or-update-comment#where-to-find-the-id-of-a-comment).\n\n## Usage\n\n```yml\n- name: Update PR with test results\n  uses: edumserrano/find-create-or-update-comment@v2\n  with:\n    issue-number: ${{ github.event.pull_request.number }}\n    body-includes: '\u003c!-- some-unique-id --\u003e'\n    comment-author: 'github-actions[bot]'\n    body: | # can be a single value or you can compose text with multi-line values\n      \u003c!-- some-unique-id --\u003e\n      My awesome comment\n    edit-mode: replace\n```\n\nThe above usage example is using a trick to uniquely identify a comment with some text.\n\nThe GitHub comment contains a markdown comment using the `\u003c!-- this is a comment --\u003e` syntax. The markdown comment text should then be a unique identifier that we can use to search for. This way we can set unique ids for the comments but don't make them visible to the user/whoever is reading the comment on GitHub.\n\nAlso note that you can pass input from other steps into the `body` param by doing something like:\n\n```yml\nbody: |\n  \u003c!-- some-unique-id --\u003e\n  ${{ steps.some-step-id.outputs.some-step-output }}\n```\n\nAlternatively to using an inline `body` you can use the `body-path` to specify a file to use.\n\n## Action inputs\n\n| Name                  | Description                                                                                                                       | Required                             | Default value                            |\n| --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ---------------------------------------- |\n| `token`               | GITHUB_TOKEN or a repo scoped PAT.                                                                                                | yes                                  | `github.token` (job token)               |\n| `repository`          | The full name of the repository containing the issue or pull request where to find, create or update the comment.                 | yes                                  | `github.repository` (current repository) |\n| `issue-number`        | The number of the issue or pull request in which to find, create or update the comment.                                           | yes                                  | -                                        |\n| `body-includes`       | A string to search for in the body of comments. Cannot be used in conjunction with `body-regex`.                                  | yes, unless `body-regex` is used.    | -                                        |\n| `body-regex`          | A regular expression to search for in the body of comments. Cannot be used in conjunction with `body-includes`.                   | yes, unless `body-includes` is used. | -                                        |\n| `direction`           | Search direction, specified as `first` or `last`                                                                                  | no                                   | `first`                                  |\n| `nth`                 | 0-indexed number, specifying which comment to update if multiple are found .                                                      | no                                   | 0                                        |\n| `comment-author`      | The GitHub user name of the comment author.                                                                                       | false                                | -                                        |\n| `body`                | The comment body. Cannot be used in conjunction with `body-path`.                                                                 | yes, unless `body-path` is used.     | -                                        |\n| `body-path`           | The path to a file containing the comment body. Cannot be used in conjunction with `body`.                                        | yes, unless `body` is used.          | -                                        |\n| `edit-mode`           | The mode when updating a comment, `replace` or `append`.                                                                          | false                                | `append`                                 |\n| `append-separator`    | The separator to use when appending to an existing comment. (`newline`, `space`, `none`).                                         | false                                | `newline`                                |\n| `reactions`           | A comma separated list of reactions to add to the comment (`+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`, `rocket`, `eyes`). | false                                | -                                        |\n| `reactions-edit-mode` | The mode when updating comment reactions, `replace` or `append`.                                                                  | false                                | `append`                                 |\n\n## Dev notes\n\nFor notes aimed at developers working on this repo or just trying to understand it go [here](/docs/dev-notes/README.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedumserrano%2Ffind-create-or-update-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedumserrano%2Ffind-create-or-update-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedumserrano%2Ffind-create-or-update-comment/lists"}