From 567bf5694e50e867056ce04eb0ce49e171b36396 Mon Sep 17 00:00:00 2001 From: madomado Date: Mon, 7 Jul 2025 01:28:06 +0800 Subject: [PATCH] fix(ci): grep version properly (#5778) Signed-off-by: madomado --- .github/workflows/mg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mg.sh b/.github/workflows/mg.sh index 2bb4d68768..1195f8d31c 100755 --- a/.github/workflows/mg.sh +++ b/.github/workflows/mg.sh @@ -12,9 +12,9 @@ if [[ $1 == false ]]; then fi for f in anda-build/rpm/rpms/*; do - n=$(lesspipe.sh $f | grep -E "Name\s*: " | sed "s@Name\s*: @@") - v=$(lesspipe.sh $f | grep -E "Version\s*: " | sed "s@Version\s*: @@") - r=$(lesspipe.sh $f | grep -E "Release\s*: " | sed "s@Release\s*: @@") + n=$(lesspipe.sh $f | grep -E "Name\s*: " | sed "s@Name\s*: @@" | head -n1) + v=$(lesspipe.sh $f | grep -E "Version\s*: " | sed "s@Version\s*: @@" | head -n1) + r=$(lesspipe.sh $f | grep -E "Release\s*: " | sed "s@Release\s*: @@" | head -n1) d=${p/\%v/$v} d=${d/\%r/$r} curl -H "Authorization: Bearer $6" https://madoguchi.fyralabs.com/ci5/terra$3/builds/$n -X PUT -H "Content-Type: application/json" -d $d --fail-with-body