Skip to content

Commit

Permalink
feat(gitlint): add gitlint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Jul 6, 2023
1 parent b18f2de commit 898c100
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/gitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#SPDX-FileCopyrightText: 2023 Birger Schacht
#SPDX-License-Identifier: MIT
# Works only on PRs at the moment
name: Run gitlint on pull requests

on:
workflow_call:
inputs:
ignore:
required: false
type: string
# B6: body-is-missing
default: "B6"
contrib:
required: false
type: string
default: "contrib-title-conventional-commits"

jobs:
gitlint:
runs-on: ubuntu-latest
steps:
- name: Fail if not PR
if: github.event_name != 'pull_request'
run: |
echo "::error This workflow works only with pull requests"
exit 1
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install gitlint
run: sudo apt-get -y install gitlint
- name: Run gitlint
if: github.event_name == 'pull_request'
run: |
gitlint --fail-without-commits --debug --contrib ${{inputs.contrib}} --ignore ${{inputs.ignore}} --commits ${{github.event.pull_request.base.sha}}...${{github.event.after}}

0 comments on commit 898c100

Please sign in to comment.