From beef714a30ee661fc6c9187bf32078cbd23895c2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sat, 21 Mar 2026 00:45:57 +0100 Subject: [PATCH] ci: Add linter to make sure all commits are DCO signed Mentioned in the CONTRIBUTING.md as well. Let's enforce it. Signed-off-by: Michael Vetter --- .github/workflows/commit-lint.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index c32dc3e8..48aa6d91 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -1,17 +1,34 @@ -name: "Commits" +name: "Lint" on: pull_request: branches: [master] + types: [opened, synchronize, reopened] jobs: - lint: + commitlint: + name: "Conventional Commits" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - # Applies to all commits + # Fetch all history so commitlint can see the commits in the PR fetch-depth: 0 - name: "Conventional Commits" uses: wagoid/commitlint-github-action@v6 + + dco: + name: "DCO" + runs-on: ubuntu-latest + steps: + - name: "Get PR Commits" + id: "get-pr-commits" + uses: tim-actions/get-pr-commits@v1.3.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: "Check DCO" + uses: tim-actions/dco@v1.1.0 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }}