Skip to content

Commit

Permalink
ci(commitlint): addition of commit message linter (#20)
Browse files Browse the repository at this point in the history
Adds commitlint to check the commit message style against agreed
conventional commits configuration.
  • Loading branch information
tiborsimko committed Jan 11, 2024
1 parent 61ba41f commit 7d2c5ad
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .commitlintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
rules:
body-case: [2, always, sentence-case]
body-full-stop: [2, always]
body-leading-blank: [2, always]
body-max-line-length: [2, always, 72]
footer-leading-blank: [2, always]
footer-max-line-length: [2, always, 72]
header-max-length: [2, always, 72]
scope-case: [2, always, lower-case]
subject-case:
- 2
- never
- [pascal-case, sentence-case, start-case, upper-case]
subject-empty: [2, never]
subject-full-stop: [2, never, "."]
type-case: [2, always, lower-case]
type-empty: [2, never]
type-enum:
- 2
- always
- [build, chore, ci, docs, feat, fix, perf, refactor, style, test]
28 changes: 27 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of REANA.
# Copyright (C) 2020 CERN.
# Copyright (C) 2020, 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -9,6 +9,32 @@ name: CI
on: [push, pull_request]

jobs:
lint-commitlint:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4

- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Check commit message compliance of the recently pushed commit
if: github.event_name == 'push'
run: |
npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Check commit message compliance of the pull request
if: github.event_name == 'pull_request'
run: |
npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
lint-dockerfile:
runs-on: ubuntu-20.04
steps:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (C) 2017, 2018, 2019, 2020 CERN.
Copyright (C) 2017, 2018, 2019, 2020, 2021, 2023, 2024 CERN.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down

0 comments on commit 7d2c5ad

Please sign in to comment.