Skip to content

Commit

Permalink
chore: check commit messages with committed
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Dec 24, 2024
1 parent 1ab4591 commit 738f855
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .config/committed.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
style = "conventional"
ignore_author_re = '\[bot\]'
subject_capitalized = false
1 change: 1 addition & 0 deletions .config/mise.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tools]
committed = "1.1.5"
dprint = "0.47.6"
lefthook = "latest"
shellcheck = "0.10.0"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # for commit message checks
- uses: jdx/mise-action@5bb8f8c1911837cf42064e6490e7634fc842ee7e # v2.1.8
- name: Run checks
- name: Check commit messages
run: lefthook run commit-msgs-on-pr-branch --no-tty
if: ${{ github.event_name == 'pull_request' }}
- name: Check code
env:
FORCE_COLOR: true
LEFTHOOK_QUIET: meta,execution
Expand Down
10 changes: 10 additions & 0 deletions .lefthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ pre-commit:
rc=$?
test $rc -eq 0 || echo "error: found files modified by hooks" >&2
exit $rc
commit-msg:
commands:
committed:
run: mise exec -- committed --config .config/committed.toml --fixup --wip --commit-file "{1}"

commit-msgs-on-pr-branch:
commands:
committed:
run: mise exec -- committed --config .config/committed.toml -vv --no-merge-commit HEAD~..HEAD^2

0 comments on commit 738f855

Please sign in to comment.