Skip to content

Commit

Permalink
style: add commitlint to hook and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BlakeHolifield committed Sep 26, 2024
1 parent 044b80e commit aae81d7
Show file tree
Hide file tree
Showing 5 changed files with 511 additions and 270 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ jobs:
- uses: './.github/actions/cypress-cache'
- name: Install deps
run: npm ci
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
# cache node modules for all jobs to use
- uses: './.github/actions/node-cache'
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
lint:
needs: [install]
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {extends: ['@commitlint/config-conventional']};
Loading

0 comments on commit aae81d7

Please sign in to comment.