From eacebb4f53596d359df80f614c7b6905e7fb1f9f Mon Sep 17 00:00:00 2001 From: Arne Harren Date: Tue, 26 May 2026 14:37:46 +0200 Subject: [PATCH 1/4] add a guard preinstall script --- scripts/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/package.json b/scripts/package.json index c3393e0..6b406a3 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -8,5 +8,8 @@ "jsonpath-plus": "10.4.0", "node-dir": "0.1.17", "yaml": "2.8.3" + }, + "scripts": { + "preinstall": "echo 'error: npm scripts are enabled; disable scripts or use npm install --ignore-scripts'; exit 1" } -} +} \ No newline at end of file From c681e9ad79cec7d71e48f6219fc64779a28ceef0 Mon Sep 17 00:00:00 2001 From: Arne Harren Date: Tue, 26 May 2026 14:48:48 +0200 Subject: [PATCH 2/4] add test action --- .github/workflows/test.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5373f55 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Run Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install latest npm cli + run: npm install -g npm@latest + + - name: Install script dependencies + run: | + cd ./scripts + npm install --ignore-scripts + + - name: Run schema tests + run: | + cd ./scripts + ./test-schema ../schemas/v1.0/schema.yaml ../schemas/v1.0/tests + + - name: Run schema conversion + run: | + cd ./scripts + ./yaml2json < ../schemas/v1.0/schema.yaml > ../schemas/v1.0/schema.json From 4f1aef230bd0a54d5ad76359f42e46e23ef1ad7b Mon Sep 17 00:00:00 2001 From: Arne Harren Date: Tue, 26 May 2026 14:58:43 +0200 Subject: [PATCH 3/4] update release action, install dependencies without install scripts --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ddca44..c0c7434 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,12 +20,10 @@ jobs: - name: Install latest npm cli run: npm install -g npm@latest - # Skipping install since all assets are pre-built already - # - run: npm install - + - name: Generate other schema file formats - run: | cd ./scripts - npm install + npm install --ignore-scripts ./yaml2json < ../schemas/v1.0/schema.yaml > ../schemas/v1.0/schema.json - name: Publish package From a2c620abfa77f969087272067b9c2b471e95d806 Mon Sep 17 00:00:00 2001 From: Arne Harren Date: Tue, 26 May 2026 15:18:37 +0200 Subject: [PATCH 4/4] breaking test --- schemas/v1.0/tests/document/info/dbms/required.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/v1.0/tests/document/info/dbms/required.yaml b/schemas/v1.0/tests/document/info/dbms/required.yaml index a7c795d..f46ecc2 100644 --- a/schemas/v1.0/tests/document/info/dbms/required.yaml +++ b/schemas/v1.0/tests/document/info/dbms/required.yaml @@ -2,7 +2,7 @@ fail: - instance: /info/dbms schema: required detail: kind - - instance: /info/dbms + - instance: /info/foo schema: required detail: version