Skip to content

Commit

Permalink
ci: add reusable commitlint workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Jun 11, 2024
1 parent 4ee26ae commit 30d19f0
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 38 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/lint-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
workflow_call:

jobs:
lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: wagoid/commitlint-github-action@v4
with:
configFile: ${{ steps.commitlint.outputs.config_path }}
18 changes: 18 additions & 0 deletions .github/workflows/lint-pr-title-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_call:

jobs:
lint-pr-title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: JulienKode/[email protected]
with:
configuration-path: ${{ steps.commitlint.outputs.config_path }}
9 changes: 9 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: lint-pr-title

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
lint-pr-title:
uses: ./.github/workflows/lint-pr-title-reusable.yml
2 changes: 2 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ concurrency:
cancel-in-progress: ${{ !contains(github.ref, fromJSON('["master", "main"]')) }}

jobs:
lint-commits:
uses: ./.github/workflows/lint-commits.yml
lint:
uses: ./.github/workflows/lint.yml
test:
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/verify-commits.yml

This file was deleted.

0 comments on commit 30d19f0

Please sign in to comment.