{"id":15638048,"url":"https://github.com/peter-evans/commit-comment","last_synced_at":"2025-05-15T14:07:36.589Z","repository":{"id":42672411,"uuid":"216507597","full_name":"peter-evans/commit-comment","owner":"peter-evans","description":"A GitHub action to create a comment for a commit on GitHub","archived":false,"fork":false,"pushed_at":"2025-05-08T19:28:55.000Z","size":2770,"stargazers_count":96,"open_issues_count":1,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T20:30:50.463Z","etag":null,"topics":["commit-comment","github-actions","github-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/peter-evans.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,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"peter-evans"}},"created_at":"2019-10-21T07:45:57.000Z","updated_at":"2025-05-08T19:28:01.000Z","dependencies_parsed_at":"2024-02-15T20:27:21.341Z","dependency_job_id":"5aeda93e-ef3a-4fea-8905-c50aab9b5a95","html_url":"https://github.com/peter-evans/commit-comment","commit_stats":{"total_commits":230,"total_committers":7,"mean_commits":"32.857142857142854","dds":0.4217391304347826,"last_synced_commit":"0103ff8e0382515b11fb8bc999c091e5664d9abd"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fcommit-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fcommit-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fcommit-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fcommit-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter-evans","download_url":"https://codeload.github.com/peter-evans/commit-comment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"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","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":["commit-comment","github-actions","github-api"],"created_at":"2024-10-03T11:17:14.207Z","updated_at":"2025-05-15T14:07:31.576Z","avatar_url":"https://github.com/peter-evans.png","language":"TypeScript","readme":"# Commit Comment\n[![CI](https://github.com/peter-evans/commit-comment/workflows/CI/badge.svg)](https://github.com/peter-evans/commit-comment/actions?query=workflow%3ACI)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Commit%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/commit-comment)\n\nA GitHub action to create a comment for a commit on GitHub.\n\n![Commit Comment Example](https://github.com/peter-evans/commit-comment/blob/main/comment-example.png?raw=true)\n\n## Usage\n\n### Add a comment to the current context's commit SHA\n\nThe SHA defaults to `github.sha` OR, for `pull_request` events `github.event.pull_request.head.sha`.\n\n```yml\n      - name: Create commit comment\n        uses: peter-evans/commit-comment@v3\n        with:\n          body: |\n            This is a multi-line test comment\n            - With GitHub **Markdown** :sparkles:\n            - Created by [commit-comment][1]\n\n            [1]: https://github.com/peter-evans/commit-comment\n          reactions: '+1'\n```\n\n### Update a commit comment\n\n```yml\n      - name: Update commit comment\n        uses: peter-evans/commit-comment@v3\n        with:\n          comment-id: 557858210\n          body: |\n            **Edit:** Some additional info\n          reactions: eyes\n```\n\n### Add commit comment reactions\n\n```yml\n      - name: Add reactions\n        uses: peter-evans/commit-comment@v3\n        with:\n          comment-id: 557858210\n          reactions: |\n            heart\n            hooray\n            laugh\n```\n\n## Action inputs\n\n| Name | Description | Default |\n| --- | --- | --- |\n| `token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). | `GITHUB_TOKEN` |\n| `repository` | The full name of the target repository. | `github.repository` (current repository) |\n| `sha` | The commit SHA. | `github.sha` OR, for `pull_request` events `github.event.pull_request.head.sha` |\n| `path` | Relative path of the file to comment on. | |\n| `position` | Line index in the diff to comment on. | |\n| `comment-id` | The id of the comment to update. | |\n| `body` | The comment body. Cannot be used in conjunction with `body-path`. | |\n| `body-path` | The path to a file containing the comment body. Cannot be used in conjunction with `body`. | |\n| `edit-mode` | The mode when updating a comment, `replace` or `append`. | `append` |\n| `append-separator` | The separator to use when appending to an existing comment. (`newline`, `space`, `none`) | `newline` |\n| `reactions` | A comma or newline separated list of reactions to add to the comment. (`+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`, `rocket`, `eyes`) | |\n| `reactions-edit-mode` | The mode when updating comment reactions, `replace` or `append`. | `append` |\n\nNote: In *public* repositories this action does not work in `pull_request` workflows when triggered by forks.\nAny attempt will be met with the error, `Resource not accessible by integration`.\nThis is due to token restrictions put in place by GitHub Actions. Private repositories can be configured to [enable workflows](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#enabling-workflows-for-forks-of-private-repositories) from forks to run without restriction. See [here](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#restrictions-on-repository-forks) for further explanation. Alternatively, use the [`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target) event to comment on pull request commits.\n\n#### Outputs\n\nThe ID of the created comment will be output for use in later steps.\nNote that in order to read the step output the action step must have an id.\n\n```yml\n      - name: Create commit comment\n        uses: peter-evans/commit-comment@v3\n        id: cc\n        with:\n          body: |\n            My comment\n      - name: Check outputs\n        run: |\n          echo \"Comment ID - ${{ steps.cc.outputs.comment-id }}\"\n```\n\n### Setting the comment body from a file\n\n```yml\n      - name: Create commit comment\n        uses: peter-evans/commit-comment@v3\n        with:\n          body-path: 'comment-body.md'\n```\n\n### Using a markdown template\n\nIn this example, a markdown template file is added to the repository at `.github/comment-template.md` with the following content.\n```\nThis is a test comment template\nRender template variables such as {{ .foo }} and {{ .bar }}.\n```\n\nThe template is rendered using the [render-template](https://github.com/chuhlomin/render-template) action and the result is used to create the comment.\n```yml\n      - name: Render template\n        id: template\n        uses: chuhlomin/render-template@v1.4\n        with:\n          template: .github/comment-template.md\n          vars: |\n            foo: this\n            bar: that\n\n      - name: Create commit comment\n        uses: peter-evans/commit-comment@v3\n        with:\n          body: ${{ steps.template.outputs.result }}\n```\n\n### Accessing commits and comments in other repositories\n\nYou can create and update commit comments in another repository by using a [PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) instead of `GITHUB_TOKEN`.\nThe user associated with the PAT must have write access to the repository.\n\n## License\n\n[MIT](LICENSE)\n","funding_links":["https://github.com/sponsors/peter-evans"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-evans%2Fcommit-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter-evans%2Fcommit-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-evans%2Fcommit-comment/lists"}