We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8e459a commit d814b53Copy full SHA for d814b53
.github/workflows/commitlint.yml
@@ -23,7 +23,17 @@ jobs:
23
- name: Lint commit message
24
run: |
25
if [ "${{ github.event_name }}" = "pull_request" ]; then
26
- yarn commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.event.pull_request.head.sha }}
+ # Only lint first-parent non-merge commits to skip merged upstream history
27
+ commits=$(git rev-list --no-merges --first-parent \
28
+ ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }})
29
+ if [ -n "$commits" ]; then
30
+ for sha in $commits; do
31
+ echo "Linting commit $sha..."
32
+ yarn commitlint --from="$sha~1" --to="$sha"
33
+ done
34
+ else
35
+ echo "No non-merge commits to lint"
36
+ fi
37
else
38
yarn commitlint --from=HEAD~1
39
fi
0 commit comments