A GitHub action to create a comment for a commit on GitHub.
Usage
- name: Create commit comment uses: peter-evans/commit-comment@v1 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 tokensha- 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 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
Evaluating environment variables
Environment variables can be evaluated in the body input as follows.
- name: Create commit comment uses: peter-evans/commit-comment@v1 with: token: ${{ secrets.GITHUB_TOKEN }} body: | My env var: ${process.env.MY_ENV_VAR}
