mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
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.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user