From a268a9e741da19cde70f6bd15b2207e16676fdb5 Mon Sep 17 00:00:00 2001 From: kisekinopureya Date: Wed, 23 Jul 2025 17:37:14 +0300 Subject: [PATCH] feat: add commitlint ci --- .gitea/workflows/commit-lint.yml | 33 +++++++++++++++++++++++++++ .gitea/workflows/commitlint.config.js | 1 + 2 files changed, 34 insertions(+) create mode 100644 .gitea/workflows/commit-lint.yml create mode 100644 .gitea/workflows/commitlint.config.js diff --git a/.gitea/workflows/commit-lint.yml b/.gitea/workflows/commit-lint.yml new file mode 100644 index 0000000..58376ca --- /dev/null +++ b/.gitea/workflows/commit-lint.yml @@ -0,0 +1,33 @@ +name: commit-lint + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + commit-lint: + runs-on: openbsd-amd64 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Use Host node + run: | + if ! command -v node &> /dev/null + then + echo "Node is not installed on the host." + exit 1 + fi + echo "Using system-installed Node: $(node version)" + + - name: Install dependencies + run: | + npm install @commitlint/{cli,config-conventional} + + - name: Lint commits + run: | + git fetch origin master --depth=100 + npx commitlint --config .gitea/workflows/commitlint.config.js --from=$(git rev-list --max-parents=0 HEAD) --to=HEAD --verbose diff --git a/.gitea/workflows/commitlint.config.js b/.gitea/workflows/commitlint.config.js new file mode 100644 index 0000000..422b194 --- /dev/null +++ b/.gitea/workflows/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] };