diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 21f23f6..08497ff 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -3,8 +3,8 @@ name: Commitlint on: push: branches-ignore: ["main"] # 排除 main 分支的 push 事件 - pull_request: - branches-ignore: ["main"] # 排除 main 分支的 pull request 事件 + pull_request: # 修正为 pull_request + # main 分支的 pull request 事件也会运行 workflow_dispatch: jobs: @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v3 with: - node-version: '20' + node-version: '16' # 使用一个稳定的 Node.js 版本,比如 16 - run: npm install -g @commitlint/cli @commitlint/config-conventional - run: | echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js