Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Conventional Commits linter for CI #28

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
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
42 changes: 42 additions & 0 deletions .github/workflows/commit-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: commit-linter

on:
pull_request:
push:
branches: [main]

jobs:
commit-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20
case: 'pnpm'

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Install commitlint
run: |
pnpm install --frozen-lockfile

- name: Print versions
run: |
git --version
node --version
pnpm --version
pnpm exec commitlint --version

- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: pnpm exec commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: pnpm exec commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
6 changes: 6 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [2, 'always', 'sentence-case'] // override default
}
};
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"react-vega": "^7.6.0",
"tabler-icons-react": "^1.55.0",
"use-editable": "^2.3.3",
"vega": "^5.22.1",
"vega-lite": "^5.6.0"
"vega": "^5.28.0",
"vega-lite": "^5.18.0"
},
"peerDependencies": {
"@emotion/react": "^11.10.4",
Expand Down Expand Up @@ -45,7 +45,9 @@
"husky": "^8.0.1",
"prettier": "2.7.1",
"storybook": "^8.0.9",
"typescript": "^4.8.4"
"typescript": "^4.9.5",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2"
},
"scripts": {
"clean": "scripts/clean.sh",
Expand Down
Loading
Loading