Skip to content
Snippets Groups Projects
Unverified Commit f5034522 authored by Simonas's avatar Simonas Committed by GitHub
Browse files

Merge pull request #74 from aurelio-labs/fix-conventional-commits-to-pr-titles

fix: Coventional commits for PR titles
parents 3f9c3845 7d0b9d92
No related branches found
No related tags found
No related merge requests found
name: Conventional Commits
# 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:
build:
name: Conventional Commits
lint-pr:
if: "${{ !contains(github.event.pull_request.title, 'chore(main): release') }}"
name: Lint PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: webiny/action-conventional-commits@v1.1.0
- 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'
......@@ -61,3 +61,9 @@ repos:
stages:
- post-commit
- push
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0
hooks:
- id: commitlint
stages: [commit-msg]
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [0, 'never'],
'subject-max-length': [2, 'always', 60],
'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'style', 'test']],
},
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment