From eb02a7d230bba91ae9f0639e0f9a0b41f3276373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Tue, 14 Jan 2025 14:15:06 +0100 Subject: [PATCH] Ci no Assets Contract exit properly --- .github/workflows/ci.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b5e03254f..258b892d3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -123,8 +123,15 @@ jobs: # Debug: Check git diff output echo "Git diff output between $base_branch and $current_branch:" - git diff --name-status "origin/$base_branch" || exit 0 + git diff --name-status "origin/$base_branch" > diff_output.txt + # Check if any contract.py file exists in the diff + if ! grep -q '^A\|^R.*assets/[^/]+/smart_contracts/[^/]+/contract\.py$' diff_output.txt; then + echo "No matching 'contract.py' files found in the 'assets' folder. Skipping further processing." + echo "path=" >> $GITHUB_ENV + echo "::set-output name=path::" + exit 0 + fi # Extract added or renamed files matching the pattern file=$(git diff --name-status "origin/$base_branch" | grep -E '^A|R' | sed -n 's/^[A-Z][0-9]*[[:space:]]\+\([^[:space:]]\+\)$/\1/p' | grep -E '^assets/[^/]+/smart_contracts/[^/]+/contract\.py$' | head -n 1)