Skip to content

Instantly share code, notes, and snippets.

@lodotek
Created September 7, 2021 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lodotek/69838408246d509a3d76732f4472a8d0 to your computer and use it in GitHub Desktop.
Save lodotek/69838408246d509a3d76732f4472a8d0 to your computer and use it in GitHub Desktop.
GH Action Pre-Commit msg check workflow
---
name: CI
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check commit message
uses: gsactions/commit-message-checker@v1
with:
pattern: '^(([A-Z]{1,5}[-]{1}[0-9]{1,6}|(feat|fix|docs|style|refactor|perf|test|build|ci|chore|license|revert|bump|make|localize|skip\ ci)(\([a-z ]+\)|\([A-Z]{1,5}[-]{1}[0-9]{1,6}\))?))(!)?[\:][\ ](([a-zA-Z]{1,100}.{0,255}))$'
flags: 'gm'
error: |
Your commit message format is invalid, it must include a valid prefix: feat, fix, docs, style,
refactor, perf, test, build, ci, chore, license, revert, bump, make, localize, skip ci or a
Jira ticket format (e.g 'fix: my commit message', 'fix(scope): my commit message' or 'ABC-123: my commit message').
If you are introducing a breaking change, you must append an exclamation mark to the prefix
right before the colon or specify a footer with the format 'BREAKING CHANGE: summary'.
- name: Checkout
uses: actions/checkout@v2
- name: Setup Cookiecutter
run: pip install --user cookiecutter
- name: Run Cookiecutter
run: make test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment