feat: add commitlint ci
All checks were successful
commit-lint / commit-lint (push) Successful in 49s
All checks were successful
commit-lint / commit-lint (push) Successful in 49s
This commit is contained in:
parent
9f19df48db
commit
a268a9e741
33
.gitea/workflows/commit-lint.yml
Normal file
33
.gitea/workflows/commit-lint.yml
Normal file
@ -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
|
||||||
1
.gitea/workflows/commitlint.config.js
Normal file
1
.gitea/workflows/commitlint.config.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = { extends: ['@commitlint/config-conventional'] };
|
||||||
Loading…
x
Reference in New Issue
Block a user