From 8cce2d6c47dcd14e219971b44428744222ed1603 Mon Sep 17 00:00:00 2001 From: Wille Marcel Date: Fri, 3 May 2024 18:28:23 -0300 Subject: [PATCH] YAML validator --- .github/workflows/validate.yml | 13 +++++++++++++ schema.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/validate.yml create mode 100644 schema.yaml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..13f1b6f --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,13 @@ +name: Validate YAML +on: [push] +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: navikt/yaml-validator@v4 + with: + schema_path: schema.yaml + document_path: campaigns/ + validate_file_extension: 'no' # optional, defaults shown, enum of ['yes', 'no'] + filter_extensions: '.yaml' \ No newline at end of file diff --git a/schema.yaml b/schema.yaml new file mode 100644 index 0000000..c8a7e99 --- /dev/null +++ b/schema.yaml @@ -0,0 +1,32 @@ +--- +deployments: + required: true + type: list + schema: + type: dict + schema: + name: + required: true + type: string + platforms: + required: true + type: list + schema: + name: + required: true + type: string + tsv_format: + require: false + type: boolean + rename_as_ict: + require: false + type: boolean + process_as_ict: + require: false + type: boolean + coords_divisor: + require: false + type: integer + files: + required: true + type: list \ No newline at end of file