Skip to content

Commit 5c061fc

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 5c061fc

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ 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+
- name: Install gitlint
71+
run: |
72+
python3 -m venv venv.gitlint
73+
./venv.gitlint/bin/pip install gitlint==0.19.1
74+
- name: Run gitlint
75+
run: ./venv.gitlint/bin/gitlint -C .gitlint --commits origin/master.. lint
76+
6077
# Run the test suite in a container per-ceph-codename
6178
test-suite:
6279
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)