pull-request-vir
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

pull-request-vir

GitHub Action for pull requests.

type docs: https://electrovir.github.io/pull-request-vir

usage

  1. Install this package into whatever repo you're planning to use it.

    • npm i -D pull-request-vir
  2. Create a config file somewhere in the repo (not within source code).

    1. The config file can be named anything but must be JavaScript or TypeScript.

    2. If using TypeScript, import the Config type into the config file.

    3. 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,
                  codeOwners: {
                      paths: [/^src\/backend\//],
                  },
              },
          ],
      };
  3. 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/checkout@v4.1.1
                - uses: electrovir/pull-request-vir@latest
                  with:
                      config_file: relative/path/to/config.ts
  4. Push to GitHub and watch the magic.

Package Sidebar

Install

npm i pull-request-vir

Weekly Downloads

136

Version

1.4.1

License

(MIT or CC0 1.0)

Unpacked Size

73.1 kB

Total Files

43

Last publish

Collaborators

  • electrovir