Github action to enforce Pull Request title conventions
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.
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.
.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]