This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-steward.git
The following commit(s) were added to refs/heads/main by this push:
new b0c4d47 Fix failed hook summary extraction (#421)
b0c4d47 is described below
commit b0c4d4765b5a87b89d24da01078df20b5c075487
Author: anhtnt90dev <[email protected]>
AuthorDate: Mon Jun 1 00:57:48 2026 +0700
Fix failed hook summary extraction (#421)
---
tools/dev/agent-pre-commit.sh | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tools/dev/agent-pre-commit.sh b/tools/dev/agent-pre-commit.sh
index 1ed7526..9b3f417 100755
--- a/tools/dev/agent-pre-commit.sh
+++ b/tools/dev/agent-pre-commit.sh
@@ -77,7 +77,21 @@ echo "agent-pre-commit: ❌ one or more checks failed (exit
$prek_rc)" >&2
echo "Review the output above, fix the issues, and run this script again." >&2
# Extract which hooks failed for a quick summary.
-failed_hooks=$(echo "$prek_output" | grep -E '\[41mFailed\[49m' | sed
's/.*\[41mFailed\[49m.*/ - FAILED/' | sed 's/^ - FAILED //')
+failed_hooks=$(
+ echo "$prek_output" | awk '
+ {
+ line = $0
+ gsub(/\033\[[0-9;]*m/, "", line)
+ if (line ~ /\.+Failed/) {
+ sub(/\.+Failed.*/, "", line)
+ sub(/[[:space:]]+$/, "", line)
+ if (line != "") {
+ print " - " line
+ }
+ }
+ }
+ '
+)
if [[ -n "$failed_hooks" ]]; then
echo "" >&2
echo "Failed hooks:" >&2