Skip to content

Commit

Permalink
feat: Added wagoid/commitlint-github-action as a build step (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion authored May 23, 2024
1 parent b62addd commit 59e2b2e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci-dotnet-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages

jobs:
commitlinter:
name: Lint commit messages
uses: ./.github/workflows/step-commitlint.yml
secrets: inherit

build-and-test:
name: Build and Test ${{ inputs.solution }}
needs:
- commitlinter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/cicd-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ env:
DOTNET_NOLOGO: true

jobs:
commitlinter:
name: Lint commit messages
uses: ./.github/workflows/step-commitlint.yml
secrets: inherit

version:
name: Version
needs:
- commitlinter
uses: ./.github/workflows/step-dotnet-version.yml
with:
dotnet-version: ${{ inputs.dotnet-version || '8.x' }}
Expand All @@ -72,6 +79,8 @@ jobs:

format:
name: Format
needs:
- commitlinter
if: ${{ inputs.disableCodeFormat == false }}
uses: ./.github/workflows/step-dotnet-format.yml
with:
Expand All @@ -84,6 +93,8 @@ jobs:

codeql:
name: CodeQL
needs:
- commitlinter
if: ${{ inputs.disableCodeQL == false }}
uses: ./.github/workflows/step-dotnet-codeql.yml
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/step-node-commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_call:
secrets:
FETCH_TOKEN:
required: false

permissions:
contents: read
pull-requests: read

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

# Run the commitlint action, considering its own dependencies and yours as well 🚀
# `github.workspace` is the path to your repository.
- uses: wagoid/commitlint-github-action@v6
env:
NODE_PATH: ${{ github.workspace }}/node_modules

0 comments on commit 59e2b2e

Please sign in to comment.