Skip to content

Commit ac23385

Browse files
authored
chore: enforce conventional commit messages (#7)
* chore: enforce conventional commit messages * fixup! chore: enforce conventional commit messages
1 parent 886cfbd commit ac23385

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/commitlint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Conventional Commit Linter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
commitlint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Compute number of commits to fetch
17+
id: nb-of-commits
18+
# `+ 1` for PRs because of the merge commit
19+
run: |
20+
echo "toParse=$(echo "$EVENT" | jq -r 'if .commits then (.commits | length) else (.pull_request.commits + 1) end')" >> $GITHUB_OUTPUT
21+
env:
22+
EVENT: ${{ toJSON(github.event) }}
23+
- name: Checkout
24+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
25+
with:
26+
persist-credentials: false
27+
sparse-checkout: .
28+
fetch-depth: ${{ steps.nb-of-commits.outputs.toParse }}
29+
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1

0 commit comments

Comments
 (0)