-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/scroll-to-top
- Loading branch information
Showing
32 changed files
with
772 additions
and
1,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Validate case studies structures | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
paths: | ||
- 'config/casestudies/*.yml' | ||
|
||
jobs: | ||
validate: | ||
if: github.event.pull_request.draft == false | ||
name: Validate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v35 | ||
with: | ||
files: config/casestudies/*.yml | ||
- name: Install ajv and yaml | ||
run: npm install [email protected] [email protected] [email protected] | ||
- name: Run validation script | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { readFile } = require("fs/promises"); | ||
const Ajv = require("ajv"); | ||
const addFormats = require("ajv-formats"); | ||
const YAML = require("yaml"); | ||
const ajv = new Ajv({ | ||
allErrors: true, | ||
}); | ||
addFormats(ajv); | ||
try { | ||
const schema = await readFile("scripts/casestudies/schema.json", "utf-8"); | ||
const fileNames = `${{steps.changed-files.outputs.all_changed_files}}`.trim().split(" "); | ||
const validate = ajv.compile(JSON.parse(schema)); | ||
for (const fileName of fileNames) { | ||
const study = await readFile(fileName, "utf-8"); | ||
const valid = validate(YAML.parse(study)); | ||
if (valid === true) { | ||
core.info(`${fileName} is valid`); | ||
} else { | ||
core.setFailed(`${fileName} is invalid:`); | ||
core.setFailed(validate.errors); | ||
} | ||
} | ||
} catch (error) { | ||
core.setFailed(error); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"value": "/tools/generator", | ||
"href": "https://github.com/asyncapi/generator/tree/master/docs" | ||
}, | ||
{ | ||
"value": "reference/specification/", | ||
"href": "https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md" | ||
}, | ||
{ | ||
"value":"/tools/cli", | ||
"href":"https://github.com/asyncapi/cli/tree/master/docs" | ||
}, | ||
{ | ||
"value": "", | ||
"href": "https://github.com/asyncapi/website/blob/master/pages" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.