Skip to content
alert-triangle

GitHub Action

Blumilk Pull Request title rules

v1.2.0 Latest version

Blumilk Pull Request title rules

alert-triangle

Blumilk Pull Request title rules

Github action to enforce Pull Request title conventions

Installation

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

              

- name: Blumilk Pull Request title rules

uses: blumilksoftware/[email protected]

Learn more about this action in blumilksoftware/action-pr-title

Choose a version

PR title rules action

Github action to enforce Pull Request title conventions

Usage

Default usage:

steps:
- uses: blumilksoftware/action-pr-title@master

This will use default option values and enforce a title formatted as either #123 - Some title or - Some title.

You can customize the action by overriding default options:

steps:
- uses: blumilksoftware/action-pr-title@master
  with:
    regex: '^(FOO\-\d+ )?- .+'

This will enforce a title formatted as either FOO-123 - Some title or - Some title.

See also action.yml for detailed list of options.

Note

You might want to provide types field to the pull_request definition as by default workflows are triggered only on opened, synchronize, or reopened events. Read more about it here.

on:
  pull_request:
    types: [opened, edited, synchronize, ready_for_review, reopened]

Triggering the action on anything other than pull_request will cause a failure.

Example workflow

.github/workflows/check-pr-title.yml:

name: Check PR Title
on:
  pull_request:
    branches: [ "main" ]
    types: [opened, edited, synchronize, ready_for_review, reopened]

jobs:
  check-pr-title:
    name: Check PR title
    runs-on: ubuntu-20.04
    steps:
      - uses: blumilksoftware/[email protected]