Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/validate-conventional-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Validate Conventional Commits

on:
pull_request:
branches:
- main

jobs:
validate_commits:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js and npm
uses: actions/setup-node@v2
with:
node-version: '20.12.2'

- name: Install conventional-changelog-lint
run: npm install --save-dev conventional-changelog-lint

- name: Validate commits
run: npx conventional-changelog-lint --from=origin/main --to=origin/${{ github.head_ref }}

- name: validate PR title
run: echo "${{ github.event.pull_request.title }}" | npx conventional-changelog-lint

# - name: validate PR body
# run: if [[ "${{ github.event.pull_request.body }}" =~ "(.*\n)+(.*)" ]]; then exit 0; else exit 1; fi