We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19b468a commit 63171d7Copy full SHA for 63171d7
.github/workflows/commitlint.yml
@@ -6,11 +6,24 @@ on:
6
- main
7
pull_request:
8
9
+permissions:
10
+ contents: read
11
+
12
jobs:
13
commitlint:
14
runs-on: ubuntu-latest
15
steps:
- - uses: actions/checkout@v6
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@v6
25
with:
- fetch-depth: 100
26
+ persist-credentials: false
27
+ sparse-checkout: .
28
+ fetch-depth: ${{ steps.nb-of-commits.outputs.toParse }}
29
- uses: wagoid/commitlint-github-action@v6
0 commit comments