From 7a2af108ad8f309ae89db5907a29fc8db148e975 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 Dec 2025 20:04:07 +0000 Subject: [PATCH] Remove pipes which can randomly fail apparently * Previously `git log --oneline | grep -v 7a064ae | head -n 100` was throwing an error `grep: write error: Broken pipe` which as far as I can tell is working as intended and can't be fixed. So we remove pipes and use temporary files like animals. --- .github/workflows/ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8753df22d..951a202bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,31 +26,39 @@ jobs: - name: Check commit messages (PR) if: ${{ github.event_name == 'pull_request' }} run: | - git log --oneline | grep -v 7a064ae | head -n 100 > commits + git log --oneline > a + grep -v 7a064ae a > b + head -n 100 b > c + tail -n +2 c > commits echo "Checking last 100 commits:" cat commits + cut -d ' ' -f2- commits > commit_msgs echo ================== - if cat commits | tail -n +2 | cut -d ' ' -f2- | grep -q '.\{73\}'; then + if grep -q '.\{73\}' commit_msgs; then (echo -n "::error::"; echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information."; echo "Invalid commits:"; echo; - cat commits | tail -n +2 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; + grep '.\{73\}' commit_msgs;) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; exit 1; fi - name: Check commit messages (Push) if: ${{ github.event_name == 'push' }} run: | - git log --oneline | grep -v 7a064ae | head -n 100 > commits + git log --oneline > a + grep -v 7a064ae a > b + head -n 100 b > c + cp c commits echo "Checking last 100 commits:" cat commits + cut -d ' ' -f2- commits > commit_msgs echo ================== - if cat commits | cut -d ' ' -f2- | grep -q '.\{73\}'; then + if grep -q '.\{73\}' commit_msgs; then (echo -n "::error::"; echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information."; echo "Invalid commits:"; echo; - cat commits | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; + grep -q '.\{73\}' commit_msgs;) | tr '\n' '\001' | sed -e 's#\x01#%0A#g'; exit 1; fi clang-format: