js action to auto post comments based on changes in a pull request

This GitHub action post comments based on pull request changes.
⚠️ Important: in order for action to work you need to give GitHub actions a permission to write, otherwise it will throw RequestError [HttpError]: Resource not accessible by integration. The permission can be granted in the yaml config or in the repository settings: Settings -> Actions -> General -> Workflow permissions
This action receives 2 required params:
token: your GitHub tokendatapath: a path to a yaml file with a config that contains prependMsg and checks props. prependMsg is a message that prepends to every message of the bot. Keep empty if not needed. By default it’s 🗯️ [pull-request-auto-reviewer]: (as per screenshot). checks props consists of pairs of paths and message keys. paths dedicated to specify path(s) of changes that would trigger posting of followed message as a pull request comment. In case of multiple paths they should be separated by a comma. message could be a simple string or a markdown. ExampleA typical setting may look like this:
on:
pull_request:
branches:
- main
jobs:
review:
name: Post review comments
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: pull-request-auto-reviewer
uses: pshergie/pull-request-auto-reviewer@1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
datapath: docs/data.yml