From f461ca2398c51208a6bfa7c380ae00d5bf948f3b Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Wed, 8 Jan 2025 10:55:47 +0000 Subject: [PATCH] ci: add commitlint to enforce conventional commits --- .github/workflows/_commit_lint.yaml | 21 +++++++++++++++++++++ .github/workflows/ci.yaml | 8 ++++++++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/_commit_lint.yaml diff --git a/.github/workflows/_commit_lint.yaml b/.github/workflows/_commit_lint.yaml new file mode 100644 index 0000000..38ab7c5 --- /dev/null +++ b/.github/workflows/_commit_lint.yaml @@ -0,0 +1,21 @@ +name: Lint Commits + +on: + workflow_call: + +jobs: + lint: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + steps: + - name: Checkout Source + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + + - name: Lint Commits + uses: wagoid/commitlint-github-action@v6.1.2 + with: + failOnWarnings: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7fe758a..251ccab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,14 @@ on: pull_request: jobs: + commit_lint: + # Deduplicate jobs from pull requests and branch pushes within the same repo. + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository + permissions: + contents: read + pull-requests: read + uses: ./.github/workflows/_commit_lint.yaml + devcontainer: # Deduplicate jobs from pull requests and branch pushes within the same repo. if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository