| # Copyright 2021 The IREE Authors |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| # See https://llvm.org/LICENSE.txt for license information. |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| # Runs yamllint on files modified vs the specified reference commit |
| declare -a included_files_patterns=( |
| declare -a excluded_files_patterns=( |
| included_files_pattern="$(IFS="|" ; echo "${included_files_patterns[*]?}")" |
| excluded_files_pattern="$(IFS="|" ; echo "${excluded_files_patterns[*]?}")" |
| (git diff --name-only --diff-filter=d "${BASE_REF}" || kill $$) \ |
| | grep -E "${included_files_pattern?}" \ |
| | grep -v -E "${excluded_files_pattern?}") |
| if (( ${#files[@]} == 0 )); then |
| echo "No Yaml files changed" |
| yamllint --strict "${files[@]}" |