GitHub Action for pull request reviews
CC0-1.0 License
GitHub Action for pull requests.
type docs: https://electrovir.github.io/pull-request-vir
Install this package into whatever repo you're planning to use it.
npm i -D pull-request-vir
Create a config file somewhere in the repo (not within source code).
The config file can be named anything but must be JavaScript or TypeScript.
If using TypeScript, import the Config
type into the config file.
Create a config object that matches that type and export it as the default output:
import type {Config} from 'pull-request-vir';
export const config: Config = {
// see type definition for full config options
assignToAuthor: true,
blockNoMerge: true,
reviewRules: [
{
autoAdd: true,
users: [
'electrovir',
'another-user',
'ghost',
],
required: 2,
requiredIf: [/^src\/backend\//],
},
],
};
Define a GitHub Actions workflow that uses pull-request-vir
:
# recommended triggers
on:
pull_request_review:
types: [submitted, dismissed]
pull_request:
types:
[
opened,
reopened,
labeled,
edited,
ready_for_review,
review_requested,
review_request_removed,
]
jobs:
merge-checks:
runs-on: ubuntu-latest
steps:
# pull-request-vir needs the repo checked out so it can read your config
- uses: actions/[email protected]
- uses: electrovir/pull-request-vir@latest
with:
config_file: relative/path/to/config.ts
Push to GitHub and watch the magic.