Skip to content

JoseThen/comment-pr

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Comment PR

All Contributors

This action can be used to post a dynamic comment on a github PR

Inputs

comment

Optional The comment you would like to post. Default ''.

json

Optional A JSON comment you would like to post. Default ''.

file_path

Optional Path to a file containing MarkDown (preffered) syntax with your comment.

GITHUB_TOKEN

Required The value of your GitHub Actions GitHub Token, this is usually: ${{ secrets.GITHUB_TOKEN }}.

Make sure your GITHUB_TOKEN has the proper permissions to write on a pull-request. Check here how to add permissions if necessary.

Permissions example

permissions:
  checks: read
  contents: read
  pull-requests: write

Example usage

uses: JoseThen/comment-pr@v1.2.0
with:
  comment: 'This PR is the bees knees!'
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: JoseThen/comment-pr@v1.2.0
with:
  json: '{ "this": "pr", "is": "the", "bees": "knees"}'
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: JoseThen/comment-pr@v1.2.0
with:
  file_path: './tmp/pr-comment.md'
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Development

  • You need vercel/ncc installed with npm i -g @vercel/ncc before you can compile the logic.

  • To build just make sure npm ci has been run and use ncc build index.js

  • If you don't want to download nodejs and npm you can keep this containerized on the fly with docker run --rm -it -v .:/app node:lts bash and work from the /app dir in the container.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Ciaran Evans
Ciaran Evans

📖
Bruno Henrique da Silva
Bruno Henrique da Silva

📖

This project follows the all-contributors specification. Contributions of any kind welcome!