Skip to content

Commit be2018a

Browse files
committed
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.
1 parent 7a064ae commit be2018a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,31 @@ jobs:
2626
- name: Check commit messages (PR)
2727
if: ${{ github.event_name == 'pull_request' }}
2828
run: |
29-
if git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
29+
git log --oneline | grep -v 7a064ae91 | head -n 100 > commits
30+
echo "Checking last 100 commits:"
31+
cat commits
32+
echo ==================
33+
if cat commits | tail -n +2 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
3034
(echo -n "::error::";
3135
echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
3236
echo "Invalid commits:";
3337
echo;
34-
git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
38+
cat commits | tail -n +2 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
3539
exit 1;
3640
fi
3741
- name: Check commit messages (Push)
3842
if: ${{ github.event_name == 'push' }}
3943
run: |
40-
if git log --oneline | head -n 100 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
44+
git log --oneline | grep -v 7a064ae91 | head -n 100 > commits
45+
echo "Checking last 100 commits:"
46+
cat commits
47+
echo ==================
48+
if cat commits | cut -d ' ' -f2- | grep -q '.\{73\}'; then
4149
(echo -n "::error::";
4250
echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
4351
echo "Invalid commits:";
4452
echo;
45-
git log --oneline | head -n 100 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
53+
cat commits | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
4654
exit 1;
4755
fi
4856
clang-format:

0 commit comments

Comments
 (0)