diff --git a/.woodpecker/pr.yml b/.woodpecker/pr.yml index de83631..8edbe08 100644 --- a/.woodpecker/pr.yml +++ b/.woodpecker/pr.yml @@ -10,11 +10,28 @@ clone: image: woodpeckerci/plugin-git settings: lfs: false + depth: 50 steps: + # Validate commit messages follow conventional commits + - name: commitlint + image: node:22-alpine + commands: + - npm install -g @commitlint/cli @commitlint/config-conventional + - | + echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js + - | + # Check all commits in the PR + git log --format=%s origin/main..HEAD | while read -r msg; do + echo "Checking: $msg" + echo "$msg" | commitlint || exit 1 + done + - echo "All commits follow conventional commit format" + - name: build-and-test image: mcr.microsoft.com/dotnet/sdk:10.0 commands: - dotnet restore - dotnet build -c Release - dotnet test -c Release --logger "console;verbosity=detailed" + depends_on: [commitlint]