Skip to content

Commit

Permalink
github: workflow: Add gitlint check
Browse files Browse the repository at this point in the history
gitlint is a tool to check git commit messages. This commit adds the
check to all pull requests.

Signed-off-by: Yasushi SHOJI <[email protected]>
  • Loading branch information
yashi committed Feb 25, 2024
1 parent 5668821 commit 2501d66
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/gitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: GitLint

on:
pull_request

jobs:
gitlint:
runs-on: ubuntu-latest
name: Run gitlint against all commits in a PR
steps:

- name: Install python dependencies
run: |
pip3 install gitlint
- name: Checkout the code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Setup Git (pull request)
run: |
git checkout -b this_pr
- name: Run gitlint
if: ${{ github.base_ref }}
env:
BASE_REF: ${{ github.base_ref }}
run: |
gitlint --commits origin/${BASE_REF}..this_pr

0 comments on commit 2501d66

Please sign in to comment.