Skip to content

Commit 863e658

Browse files
authored
ci(workflow): lint only PR title, not individual commits (#64)
1 parent 27d4a7a commit 863e658

1 file changed

Lines changed: 2 additions & 28 deletions

File tree

.github/workflows/commit-lint.yml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Lint Commit Messages
1+
name: Lint PR Title
22

33
on:
44
pull_request:
5-
types: [opened, edited, reopened, synchronize]
5+
types: [opened, edited, reopened]
66

77
permissions:
88
contents: read
@@ -31,29 +31,3 @@ jobs:
3131
run: |
3232
echo "Validating PR title: $PR_TITLE"
3333
echo "$PR_TITLE" | npx commitlint --verbose
34-
35-
commitlint:
36-
name: Lint Commit Messages
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: Checkout code
40-
uses: actions/checkout@v4
41-
with:
42-
fetch-depth: 0 # Fetch all history for all branches and tags
43-
44-
- name: Setup Node.js
45-
uses: actions/setup-node@v4
46-
with:
47-
node-version: '20'
48-
49-
- name: Install commitlint
50-
run: |
51-
npm install --save-dev @commitlint/cli@18.4.3 @commitlint/config-conventional@18.4.3
52-
53-
- name: Validate PR commits
54-
run: |
55-
# Get the base branch (usually main)
56-
BASE_SHA=$(git merge-base origin/${{ github.base_ref }} HEAD)
57-
58-
# Lint all commits in the PR
59-
npx commitlint --from $BASE_SHA --to HEAD --verbose

0 commit comments

Comments
 (0)