From 2069d6ca4887566b3d11d0d84c336ef58d8e30db Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:15:19 +0100 Subject: [PATCH] Update regex patterns in schema.json and refactor CI workflow (#180) --- .github/workflows/{ruby.yml => ci.yml} | 15 ++++++++++++++- schema.json | 10 +++++----- 2 files changed, 19 insertions(+), 6 deletions(-) rename .github/workflows/{ruby.yml => ci.yml} (62%) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ci.yml similarity index 62% rename from .github/workflows/ruby.yml rename to .github/workflows/ci.yml index 9360530..6939bd2 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Ruby +name: CI on: push: @@ -31,3 +31,16 @@ jobs: run: dip rubocop - name: Run tests run: dip rspec + schema-validate: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 23 + - name: Install dependencies + run: npm install -g ajv-cli + - name: Validate all dip.yml files + run: find . -type f -name 'dip.yml' | grep -v '/invalid' | xargs -I {} ajv -s schema.json -d {} diff --git a/schema.json b/schema.json index fbb7aff..d47c6b2 100644 --- a/schema.json +++ b/schema.json @@ -94,7 +94,7 @@ "type": "object", "description": "Contains subcommands with the same structure as main commands", "patternProperties": { - "^[\\w\\-\\.\\:\\/\\s]+$": { + "^[\\w\\-.:/\\s]+$": { "$ref": "#/definitions/interaction_command" } }, @@ -142,7 +142,7 @@ "type": "object", "description": "Defines the commands and their configurations", "patternProperties": { - "^[\\w\\-\\.\\:\\/\\s]+$": { + "^[\\w\\-.:/\\s]+$": { "$ref": "#/definitions/interaction_command" } }, @@ -191,13 +191,13 @@ "description": "Contains infrastructure services configuration", "additionalProperties": false, "patternProperties": { - "^[\\w\\-\\.\\:\\/\\s]+$": { + "^[\\w\\-.:/\\s]+$": { "type": "object", "additionalProperties": false, "properties": { "git": { "type": "string", - "pattern": "^(git@|git://|https?://)[\\w\\d\\.@:\\-/]+$", + "pattern": "^(git@|git://|https?://)[\\w\\d.@:/\\-]+$", "description": "Git repository URL for the infrastructure component", "examples": ["https://github.com/mycompany/redis-config.git"] }, @@ -220,5 +220,5 @@ } } }, - "required": ["version", "interaction"] + "required": ["version"] }