File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 9
9
lint-commit-message :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
+ - name : Compute number of commits in the PR
13
+ id : nb-of-commits
14
+ run : |
15
+ echo "::set-output name=plusOne::$((${{ github.event.pull_request.commits }} + 1))"
16
+ echo "::set-output name=minusOne::$((${{ github.event.pull_request.commits }} - 1))"
12
17
- uses : actions/checkout@v2
13
18
with :
14
- fetch-depth : 2
19
+ fetch-depth : ${{ steps.nb-of-commits.outputs.plusOne }}
20
+ - run : git reset HEAD^2
15
21
- name : Install Node.js
16
22
uses : actions/setup-node@v2
17
23
with :
18
24
node-version : ${{ env.NODE_VERSION }}
19
25
- name : Validate commit message
20
26
run : |
21
27
echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json"
22
- git rev-parse HEAD^ | xargs npx -q core-validate-commit --no-validate-metadata --tap
28
+ git rev-parse HEAD~${{ steps.nb-of-commits.outputs.minusOne }} | xargs npx -q core-validate-commit --no-validate-metadata --tap
You can’t perform that action at this time.
0 commit comments