Skip to content
align-left

GitHub Action

Conventional Commits Pull Request

v1.2.0 Latest version

Conventional Commits Pull Request

align-left

Conventional Commits Pull Request

Lints a pull request title based on Conventional Commits

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Conventional Commits Pull Request

uses: jef/conventional-commits-pr-action@v1.2.0

Learn more about this action in jef/conventional-commits-pr-action

Choose a version

conventional-commits-pr-action

Lints pull requests based on Conventional Commits v1.0.0.

Also has the ability to post a comment in the pull request conversation with examples.

image

Live examples:

Usage

name: Pull Request Linter
on:
  pull_request:
    types:
      - opened
      - edited
      - reopened
jobs:
  lint-pr:
    name: Lint pull request title
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write # post comments when 'comment' is true
    steps:
      - name: Lint pull request title
        uses: jef/conventional-commits-pr-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Inputs

bots_ignore

Optional A list of bots to ignore when linting the pull request title. Can be a comma-separated list.

comment

Optional Post a comment in the pull request conversation with examples.

Default value true

Note

Commenting in the pull request conversation requires that the token is configured with the pull-requests permission.

token

Required Access token to the repository. Usually ${{ secrets.GITHUB_TOKEN }}.

Contributing

There are few npm tasks that will help you in building and packaging. All commands are prefaced by npm run.

  • build: builds the action.
  • clean: removes build directory.
  • compile: transpiles TypeScript.
  • fix: fixes lint and format issues.
  • lint: runs linter and checks format issues.
  • start: runs the action.
  • test: tests the action.