From ffbc906ab1869b3a249357f7a2d17770f096e7cc Mon Sep 17 00:00:00 2001 From: Norton_Lin <75243447+Norton-Lin@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:31:20 +0800 Subject: [PATCH] feat: add commitlint workflow --- .github/workflows/commitlint.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..e3456c3 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,23 @@ +name: Commitlint + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + workflow_dispatch: + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: '20' + - 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