From 91b6db8cf6e688994c7c8cd5223dd35a7bbdeec6 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sun, 12 Apr 2026 15:15:56 +0800 Subject: [PATCH] Use grep in workflow contract guards --- .github/workflows/pipeline.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 1115e40..f463df0 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -188,10 +188,12 @@ jobs: run: | set -euo pipefail - if rg -n \ - deploy_accounts_svc_plus.yml \ - roles/vhosts/accounts_service \ - '(docker build|podman build|docker buildx build|gcloud builds submit)' \ + if grep -REn \ + -e 'docker build' \ + -e 'podman build' \ + -e 'docker buildx build' \ + -e 'gcloud builds submit' \ + deploy_accounts_svc_plus.yml roles/vhosts/accounts_service \ ; then echo "deploy flow must use the build job image artifact and must not build images on the target host" >&2 exit 1 @@ -202,8 +204,8 @@ jobs: run: | set -euo pipefail - rg -n 'ACCOUNTS_IMAGE_REF' deploy_accounts_svc_plus.yml roles/vhosts/accounts_service >/dev/null - rg -n 'IMAGE=\{\{ accounts_service_image_ref \}\}|IMAGE: "\{\{ accounts_service_image_ref \}\}"' \ + grep -REn 'ACCOUNTS_IMAGE_REF' deploy_accounts_svc_plus.yml roles/vhosts/accounts_service >/dev/null + grep -REn 'IMAGE=\{\{ accounts_service_image_ref \}\}|IMAGE: "\{\{ accounts_service_image_ref \}\}"' \ roles/vhosts/accounts_service >/dev/null - name: Set Up Python