Compare commits
1 Commits
0.1.13
..
37a8abab0e
| Author | SHA1 | Date | |
|---|---|---|---|
|
37a8abab0e
|
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
- name: Validate Renovate Config
|
- name: Validate JSON
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
json-file: renovate.json
|
json-file: renovate.json
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
||||||
"ignorePatterns": ["dist/**", "node_modules/**", "coverage/**"]
|
|
||||||
}
|
|
||||||
Vendored
+9494
-3540
File diff suppressed because one or more lines are too long
@@ -58,10 +58,10 @@ describe("validateJson()", () => {
|
|||||||
{
|
{
|
||||||
ok: true,
|
ok: true,
|
||||||
text: async () =>
|
text: async () =>
|
||||||
({
|
JSON.stringify({
|
||||||
despiteThisBeingValidJson:
|
despiteThisBeingValidJson:
|
||||||
"toString() breaks it, making it invalid",
|
"toString() breaks it, making it invalid",
|
||||||
}).toString(),
|
}),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ describe("validateJson()", () => {
|
|||||||
$schema: "https://json-schema.org/draft-07/schema",
|
$schema: "https://json-schema.org/draft-07/schema",
|
||||||
});
|
});
|
||||||
await expect(validateJson(jsonFile)).rejects.toThrow(
|
await expect(validateJson(jsonFile)).rejects.toThrow(
|
||||||
'"[object Object]" is not valid JSON',
|
'strict mode: unknown keyword: "despiteThisBeingValidJson"',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -14,9 +14,7 @@ export const validateJson = async (jsonFileContent: string): Promise<void> => {
|
|||||||
const schemaText = await schemaContent.text();
|
const schemaText = await schemaContent.text();
|
||||||
const schemaObject = JSON.parse(schemaText);
|
const schemaObject = JSON.parse(schemaText);
|
||||||
|
|
||||||
const validator = new Ajv({
|
const validator = new Ajv();
|
||||||
strict: false,
|
|
||||||
});
|
|
||||||
const validate = validator.compile(schemaObject);
|
const validate = validator.compile(schemaObject);
|
||||||
const isValid = validate(jsonObject);
|
const isValid = validate(jsonObject);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user