File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -26,31 +26,39 @@ jobs:
2626 - name : Check commit messages (PR)
2727 if : ${{ github.event_name == 'pull_request' }}
2828 run : |
29- git log --oneline | grep -v 7a064ae | head -n 100 > commits
29+ git log --oneline > a
30+ grep -v 7a064ae a > b
31+ head -n 100 b > c
32+ tail -n +2 c > commits
3033 echo "Checking last 100 commits:"
3134 cat commits
35+ cut -d ' ' -f2- commits > commit_msgs
3236 echo ==================
33- if cat commits | tail -n +2 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
37+ if grep -q '.\{73\}' commit_msgs ; then
3438 (echo -n "::error::";
3539 echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
3640 echo "Invalid commits:";
3741 echo;
38- cat commits | tail -n +2 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
42+ grep '.\{73\}' commit_msgs ;) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
3943 exit 1;
4044 fi
4145 - name : Check commit messages (Push)
4246 if : ${{ github.event_name == 'push' }}
4347 run : |
44- git log --oneline | grep -v 7a064ae | head -n 100 > commits
48+ git log --oneline > a
49+ grep -v 7a064ae a > b
50+ head -n 100 b > c
51+ cp c commits
4552 echo "Checking last 100 commits:"
4653 cat commits
54+ cut -d ' ' -f2- commits > commit_msgs
4755 echo ==================
48- if cat commits | cut -d ' ' -f2- | grep -q '.\{73\}'; then
56+ if grep -q '.\{73\}' commit_msgs ; then
4957 (echo -n "::error::";
5058 echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
5159 echo "Invalid commits:";
5260 echo;
53- cat commits | cut -d ' ' -f2- | grep ' .\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
61+ grep -q ' .\{73\}' commit_msgs ;) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
5462 exit 1;
5563 fi
5664 clang-format :
You can’t perform that action at this time.
0 commit comments