Skip to content

Commit 3f697a6

Browse files
workflows: add a check-commits CI rule
This uses the gitlint tool to check for basic formatting of commit messages. In particular we want to require the Signed-off-by on all commits. We were kinda-sorta requiring it but not always enforcing it. ceph/ceph has been requiring it for a long time. I also think it's even more important now that people declare they have the right to contribute change now that more and more tools are being used to generate code. Signed-off-by: John Mulligan <jmulligan@redhat.com>
1 parent 0713911 commit 3f697a6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ jobs:
5757
- name: Run checks
5858
run: make check
5959

60+
# Check commit messages (in particular enforce Signed-off-by)
61+
check-commits:
62+
runs-on: ubuntu-latest
63+
if: github.event_name == 'pull_request'
64+
steps:
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
66+
with:
67+
fetch-depth: 0
68+
ref: ${{ github.event.pull_request.head.sha }}
69+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
70+
with:
71+
python-version: '3.13'
72+
- name: Install gitlint
73+
run: |
74+
python3 -m venv venv.gitlint
75+
./venv.gitlint/bin/pip install gitlint==0.19.1
76+
- name: Run gitlint
77+
run: ./venv.gitlint/bin/gitlint -C .gitlint --commits origin/master.. lint
78+
6079
# Run the test suite in a container per-ceph-codename
6180
test-suite:
6281
name: test-suite (${{ matrix.ceph_version }}${{ matrix.go_version != needs.go-versions.outputs.latest && format(', go{0}', matrix.go_version) || '' }})

0 commit comments

Comments
 (0)