From a443348d1a1a32976841e9623b0223b7bc54d38c Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 21:34:31 -0800 Subject: [PATCH] Debugging from scratch --- .github/workflows/scripts/check_diff.sh | 27 +++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 63c78cc9800..32af0fa8d6d 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -3,7 +3,6 @@ set -o nounset set -o errexit set -o pipefail -set -o xtrace # Parse command line arguments head_ref=${1} @@ -13,11 +12,8 @@ clone_url=${3} # Set paths to ignore paths_ignore="^(Docs|\.github)/|\.azure-pipelines\.yml$" -# Check if remote repository already exists -if ! git remote --get-url fork > /dev/null 2>&1; then - # Add forked repository as remote - git remote add fork ${clone_url} -fi +# Add forked repository as remote +git remote add fork ${clone_url} # Fetch base branch from main repository git fetch origin ${base_ref} @@ -28,17 +24,12 @@ git fetch fork ${head_ref} # Save output of git diff to inspect files changed git diff --name-only --diff-filter=ACMRTUXB origin/${base_ref}..fork/${head_ref} > check_diff.txt -# Check if check_diff.txt is not empty -if [ -s check_diff.txt ]; then - # Set skip variable after inspecting files changed - skip=$(grep -v -E "${paths_ignore}" check_diff.txt) - # Set an environment variable based on the output - if [ -z "$skip" ]; then - echo "SKIP_CHECKS=true" >> $GITHUB_ENV - else - echo "SKIP_CHECKS=false" >> $GITHUB_ENV - fi -else - # If check_diff.txt is empty, set SKIP_CHECKS to true +# Set skip variable after inspecting files changed +skip=$(grep -v -E "${paths_ignore}" check_diff.txt) + +# Set an environment variable based on the output +if [ -z "$skip" ]; then echo "SKIP_CHECKS=true" >> $GITHUB_ENV +else + echo "SKIP_CHECKS=false" >> $GITHUB_ENV fi