CI: Fix Qt XML validator attempting to validate non-XML files

Explicitly check only for changes `.ui` files in forms subdirectory
and pass only changed files with that suffix to validator.
This commit is contained in:
PatTheMav 2023-07-19 12:46:29 +02:00 committed by Ryan Foster
parent b15fc60d63
commit 48b51ce3c4

View file

@ -44,13 +44,14 @@ runs:
: Validate XML 💯 : Validate XML 💯
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
shopt -s extglob shopt -s extglob
shopt -s globstar
changes=($(git diff --name-only HEAD~1 HEAD -- UI/forms)) changes=($(git diff --name-only HEAD~1 HEAD -- UI/forms/**/*.ui))
case "${GITHUB_EVENT_NAME}" in case "${GITHUB_EVENT_NAME}" in
pull_request) changes=($(git diff --name-only origin/"${GITHUB_BASE_REF}" HEAD -- UI/forms)) ;; pull_request) changes=($(git diff --name-only origin/"${GITHUB_BASE_REF}" HEAD -- UI/forms/**/*.ui)) ;;
push) push)
if [[ "${GITHUB_EVENT_FORCED}" == false ]]; then if [[ "${GITHUB_EVENT_FORCED}" == false ]]; then
changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD -- UI/forms)) changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD -- UI/forms/**/*.ui))
fi fi
;; ;;
*) ;; *) ;;