Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
message-square

GitHub Action

Commit Comment

v1.0.1

Commit Comment

GitHub Marketplace

A GitHub action to create a comment for a commit on GitHub.

Commit Comment Example

Usage

      - name: Create commit comment
        uses: peter-evans/commit-comment@v1.0.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          body: |
            This is a multi-line test comment
            - With GitHub **Markdown**
            - Created by [commit-comment][1]

            [1]: https://github.com/peter-evans/commit-comment

Parameters

  • token (required) - The GitHub authentication token
  • sha - The commit SHA. Defaults to the current commit.
  • body (required) - The contents of the comment.
  • path - Relative path of the file to comment on.
  • position - Line index in the diff to comment on.

Example

Here is an example setting all of the input parameters.

      - name: Create commit comment
        uses: peter-evans/commit-comment@v1.0.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          sha: 843dea1cc2e721163c20a5c876b5b155f7f3aa75
          body: |
            This is a multi-line test comment
            - With GitHub **Markdown**
            - Created by [commit-comment][1]

            [1]: https://github.com/peter-evans/commit-comment
          path: path/to/file.txt
          position: 1

License

MIT