-
Notifications
You must be signed in to change notification settings - Fork 216
27 lines (26 loc) · 1.08 KB
/
conventional_commits.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Enforces conventional commits on pull requests
# Ref: https://github.com/marketplace/actions/conventional-pull-request
name: Conventional commits pull request
on:
pull_request:
branches: [main]
types: [opened, edited, synchronize]
jobs:
lint-pr:
if: "${{ !contains(github.event.pull_request.title, 'chore(main): release') }}"
name: Lint PR
runs-on: ubuntu-latest
timeout-minutes: ${{ fromJSON(vars.DEFAULT_JOB_TIMEOUT_MINUTES) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate
uses: CondeNast/conventional-pull-request-action@v0.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitlintRulesPath: "./commitlint.config.js"
# if the PR contains a single commit, fail if the commit message and the PR title do not match
commitTitleMatch: "false" # default: 'true'
# if you squash merge PRs and enabled "Default to PR title for squash merge commits", you can disable all linting of commits
ignoreCommits: "false" # default: 'false'