From 9d0de6a85ca7209c7fc1fdb28fc05dd50b9f457f Mon Sep 17 00:00:00 2001 From: Michael Zalimeni Date: Mon, 16 Sep 2024 17:06:54 +0000 Subject: [PATCH] backport of commit 4ffa6cb36576851ada99dbdad7e92a21fb751859 --- .github/scripts/check_skip_ci.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_skip_ci.sh b/.github/scripts/check_skip_ci.sh index 628d8489dfad..a22b990f2692 100755 --- a/.github/scripts/check_skip_ci.sh +++ b/.github/scripts/check_skip_ci.sh @@ -13,7 +13,8 @@ set -euo pipefail # # ... `git merge-base origin/$SKIP_CHECK_BRANCH HEAD` would return commit `D` # `...HEAD` specifies from the common ancestor to the latest commit on the current branch (HEAD).. -files_to_check=$(git diff --name-only "$(git merge-base origin/$SKIP_CHECK_BRANCH HEAD~)"...HEAD) +skip_check_branch=${SKIP_CHECK_BRANCH:?SKIP_CHECK_BRANCH is required} +files_to_check=$(git diff --name-only "$(git merge-base origin/$skip_check_branch HEAD~)"...HEAD) # Define the directories to check skipped_directories=("docs/" "ui/" "website/" "grafana/" ".changelog/") @@ -46,4 +47,4 @@ for file_to_check in "${files_to_check_array[@]}"; do done echo "Changes detected in only documentation files - skipping tests and build" -echo "skip-ci=true" >> "$GITHUB_OUTPUT" \ No newline at end of file +echo "skip-ci=true" >> "$GITHUB_OUTPUT"