From c61e3f72f02f7c65ba60f5558f5c07fdbf2463e9 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 27 Nov 2025 14:08:07 +0000 Subject: [PATCH] Try to make CI check for commit messages more robust * For some reason the commit message check failed to detect a bad message on a PR commit. The only clue is a 'broken pipe' message from tail in the log but it doesn't reproduce on another repository with the same scripts :(. * Temporarily ignore the bad commit from future checks until it drops out of the most recent 100. --- .github/workflows/ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30a03525e..8753df22d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,23 +26,31 @@ jobs: - name: Check commit messages (PR) if: ${{ github.event_name == 'pull_request' }} run: | - if git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep -q '.\{73\}'; then + git log --oneline | grep -v 7a064ae | head -n 100 > commits + echo "Checking last 100 commits:" + cat commits + echo ================== + if cat commits | tail -n +2 | cut -d ' ' -f2- | grep -q '.\{73\}'; then (echo -n "::error::"; echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information."; echo "Invalid commits:"; echo; - git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; + cat commits | tail -n +2 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; exit 1; fi - name: Check commit messages (Push) if: ${{ github.event_name == 'push' }} run: | - if git log --oneline | head -n 100 | cut -d ' ' -f2- | grep -q '.\{73\}'; then + git log --oneline | grep -v 7a064ae | head -n 100 > commits + echo "Checking last 100 commits:" + cat commits + echo ================== + if cat commits | cut -d ' ' -f2- | grep -q '.\{73\}'; then (echo -n "::error::"; echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information."; echo "Invalid commits:"; echo; - git log --oneline | head -n 100 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; + cat commits | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; exit 1; fi clang-format: