mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-11 08:43:31 +00:00
fixed exclusion for yaml/json validation (#15950)
This commit is contained in:
parent
d5b1465406
commit
557550c876
15
.github/workflows/validate-jsons-yamls.yml
vendored
15
.github/workflows/validate-jsons-yamls.yml
vendored
@ -77,20 +77,7 @@ jobs:
|
|||||||
pip install pyyaml
|
pip install pyyaml
|
||||||
./scripts/validate_json_yaml.sh
|
./scripts/validate_json_yaml.sh
|
||||||
|
|
||||||
- name: Create a comment in the PR with the instructions
|
- name: JSON/Yaml validation failed, check the comment in the PR
|
||||||
if: steps.style.outcome != 'success'
|
|
||||||
uses: peter-evans/create-or-update-comment@v1
|
|
||||||
with:
|
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
|
||||||
body: |
|
|
||||||
**JSON/YAML Validations failed.**
|
|
||||||
|
|
||||||
Please run `./scripts/validate_json_yaml.sh` to find any bad json/yaml files and fix them.
|
|
||||||
You can also use [pre-commit](https://pre-commit.com/) to automate the Python code formatting.
|
|
||||||
|
|
||||||
You can install the pre-commit hooks with `make install_test precommit_install`.
|
|
||||||
|
|
||||||
- name: Python checkstyle failed, check the comment in the PR
|
|
||||||
if: steps.style.outcome != 'success'
|
if: steps.style.outcome != 'success'
|
||||||
run: |
|
run: |
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
set -eup pipefail
|
set -eup pipefail
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
EXCLUDED_DIRS="vscode"
|
EXCLUDED_DIRS=".vscode|great_expectations/resources"
|
||||||
echo "Validating JSON files..."
|
echo "Validating JSON files..."
|
||||||
git ls-files | grep "\.json$" | grep -vE "^($EXCLUDED_DIRS)/" | while read file; do jq . "$file" >/dev/null 2>&1 || { echo "Invalid JSON in $file"; exit 1; }; done
|
git ls-files | grep "\.json$" | grep -vE "/($EXCLUDED_DIRS)/" | while read file; do jq . "$file" >/dev/null 2>&1 || { echo "Invalid JSON in $file"; exit 1; }; done
|
||||||
echo "Validating YAML files..."
|
echo "Validating YAML files..."
|
||||||
git ls-files | grep -E "\.ya?ml$" | grep -vE "^($EXCLUDED_DIRS)/" | while read file; do python ${SCRIPT_DIR}/validate_yaml.py "$file" >/dev/null 2>&1 || { echo "Invalid YAML in $file"; exit 1; }; done
|
git ls-files | grep -E "\.ya?ml$" | grep -vE "/($EXCLUDED_DIRS)/" | while read file; do python ${SCRIPT_DIR}/validate_yaml.py "$file" >/dev/null 2>&1 || { echo "Invalid YAML in $file"; exit 1; }; done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user