Backport of ci: fix CI skip script hole into release/1.19.x (#21747)

backport of commit 4ffa6cb365

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
pull/21755/head
hc-github-team-consul-core 2024-09-16 17:05:59 -04:00 committed by GitHub
parent dda31b8c70
commit 8aafd3098c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,8 @@ set -euo pipefail
# #
# ... `git merge-base origin/$SKIP_CHECK_BRANCH HEAD` would return commit `D` # ... `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).. # `...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 # Define the directories to check
skipped_directories=("docs/" "ui/" "website/" "grafana/" ".changelog/") skipped_directories=("docs/" "ui/" "website/" "grafana/" ".changelog/")
@ -46,4 +47,4 @@ for file_to_check in "${files_to_check_array[@]}"; do
done done
echo "Changes detected in only documentation files - skipping tests and build" echo "Changes detected in only documentation files - skipping tests and build"
echo "skip-ci=true" >> "$GITHUB_OUTPUT" echo "skip-ci=true" >> "$GITHUB_OUTPUT"