beemojs / conventional-pr-action

GitHub Action that validates the PR title and commits against a Conventional Commits preset.
12 stars 3 forks source link

conventional-pr-action

GitHub Action that validates a pull request title against a Conventional Commits preset.

Setup

Create a .github/workflows/pr.yml file in your repository with the following contents. The GITHUB_TOKEN environment variable and latest actions are required.

name: PR
on: pull_request
jobs:
  conventional:
    name: Conventional PR
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - uses: beemojs/conventional-pr-action@v3
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Supports the following input options:

Choosing a preset

Conventional commits require a changelog preset, and this action defaults to conventional-changelog-beemo. If you'd like to use another preset, update the config-preset option.

- uses: beemojs/conventional-pr-action@v3
  with:
    config-preset: eslint

Furthermore, the preset must exist in node_modules for the action to work correctly. The action currently supports the following workflows:

Automatic installation

If the auto-install option is true (the default), the action will automatically install the preset at the root of the repository using your chosen package manager.

This will modify the working tree of your checkout!

Manual installation

If you don't want to use automatic installation, you'll need to disable the auto-install option, and add your chosen preset manually to devDependencies in the root package.json.

- uses: beemojs/conventional-pr-action@v3
  with:
    auto-install: false