Skip to content

Commit

Permalink
Merge pull request #10 from GG-157/main
Browse files Browse the repository at this point in the history
ci: update 提交Lint workflow to ignore main branch
  • Loading branch information
GG-157 authored Oct 10, 2024
2 parents 7d659f5 + 6b25f80 commit e0dee16
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Commitlint

on:
push:
branches: ["main"]
branches-ignore: ["main"] # 排除 main 分支的 push 事件
pull_request:
branches: ["main"]
branches-ignore: ["main"] # 排除 main 分支的 pull request 事件
workflow_dispatch:

jobs:
Expand All @@ -20,4 +20,10 @@ jobs:
- run: npm install -g @commitlint/cli @commitlint/config-conventional
- run: |
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
- run: commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Check commits
run: |
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
else
commitlint --from $(git rev-list --max-parents=0 HEAD) --to HEAD --verbose
fi

0 comments on commit e0dee16

Please sign in to comment.