From c97329d74b07321c3d895db08becafab808c95cb Mon Sep 17 00:00:00 2001 From: Matthew Watkins Date: Tue, 15 Oct 2024 14:52:55 +0100 Subject: [PATCH] Fix: Improve string extraction from .gitreview Signed-off-by: Matthew Watkins --- .github/workflows/github2gerrit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github2gerrit.yaml b/.github/workflows/github2gerrit.yaml index 4c54289..00a6f33 100644 --- a/.github/workflows/github2gerrit.yaml +++ b/.github/workflows/github2gerrit.yaml @@ -139,8 +139,8 @@ jobs: run: | set -x - gerrit_server=$(grep -E "host" .gitreview | cut -d "=" -f2) - gerrit_server_port=$(grep -E "port" .gitreview | cut -d "=" -f2) + gerrit_server=$(grep -oP -m1 '(?<=host=).*' .gitreview) + gerrit_server_port=$(grep -oP -m1 '(?<=port=).*' .gitreview) echo "GERRIT_SERVER=${gerrit_server}" >> "$GITHUB_ENV" echo "GERRIT_SERVER_PORT=${gerrit_server_port}" >> "$GITHUB_ENV"