{"id":28443188,"url":"https://github.com/kit-data-manager/json-schema-check-action","last_synced_at":"2026-06-03T16:31:33.761Z","repository":{"id":297475939,"uuid":"996668092","full_name":"kit-data-manager/json-schema-check-action","owner":"kit-data-manager","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-20T16:23:35.000Z","size":6847,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T19:08:49.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kit-data-manager.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-05T09:29:44.000Z","updated_at":"2026-05-20T16:21:21.000Z","dependencies_parsed_at":"2026-04-08T23:02:41.591Z","dependency_job_id":null,"html_url":"https://github.com/kit-data-manager/json-schema-check-action","commit_stats":null,"previous_names":["thomasjejkal/json-schema-check-action","kit-data-manager/json-schema-check-action"],"tags_count":8,"template":false,"template_full_name":"actions/typescript-action","purl":"pkg:github/kit-data-manager/json-schema-check-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fjson-schema-check-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fjson-schema-check-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fjson-schema-check-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fjson-schema-check-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kit-data-manager","download_url":"https://codeload.github.com/kit-data-manager/json-schema-check-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fjson-schema-check-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33874679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T07:10:34.101Z","updated_at":"2026-06-03T16:31:33.755Z","avatar_url":"https://github.com/kit-data-manager.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Schema Check Action\n\n[![GitHub Super-Linter](https://github.com/actions/typescript-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)\n![CI](https://github.com/actions/typescript-action/actions/workflows/ci.yml/badge.svg)\n[![Check dist/](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml)\n[![CodeQL](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml)\n[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)\n\nThis action is intended to be part of CI workflows in repositories used for JSON\nschema development. Its goal is to ensure, that the coming version of the JSON\nschema is syntactically valid and that the developer is informed about possible\nbreaking changes between schema versions, such that semantic versioning can be\nused accordingly and migration rules can be provided if necessary.\n\n## Under the hood\n\nBefore going into details, let's take a look under the hood of the action.\nAccording to its goals, the action performs four tasks:\n\n1. Validate the schema identified by its filename.\n2. Diff to previous version.\n   1. Determine the most recent release and obtain the schema.\n   2. Create a diff between the schema's current development version and the\n      most recent release version.\n3. Create and print a summary and provide the summary as output for follow-up\n   actions.\n\nIn order to get access to the current source code, of course, a checkout action\nhas to be executed in advance. Tasks 1 and 2 are optional, such that only\nvalidation, only diff, or both of them can be executed. You may also skip both,\nbut this seems not to make sense. ;-)\n\n## Usage\n\nLet's come to the usage part. As this action is supposed to be used in GitHub CI\npipelines, you should start with creating a file\n`.github/workflows/json_schema_check.yml` following the given folder structure.\nThen, open the file and start adding your JSON Schema Check workflow.\n\nAs mentioned before, it is essential to check out the code before this action\ncan run. Therefore, you may start as follows:\n\n```yaml\nname: JSON Schema Check\n\non:\n  pull_request:\n    branches: [main]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v4\n```\n\nWith this workflow definition, as soon as a pull request to the main branch is\ncreated or modified, the workflow will start with checking out the branch it was\ntriggered at, e.g., a development branch.\n\nNow we may add the actual JSON Schema Check action:\n\n```yaml\nname: JSON Schema Check\n\non:\n  pull_request:\n    branches: [main]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v4\n      - name: JSON Schema Check\n        uses: kit-data-manager/json-schema-check-action@v0.0.7\n        with:\n          schemaPath: 'schema.json'\n          validate: true\n          createDiff: true\n          token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nAs you can see, there are a couple of arguments, where some of them are\nmandatory and others are options. Details can be found in the following table.\n\n| Argument        | Description                                                                                                                                                                                                                                                                                                | Mandatory          | Default |\n| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------- |\n| schemaPath      | The relative path where the schema is located in the repository.                                                                                                                                                                                                                                           | :white_check_mark: | -       |\n| validate        | Enabled or disables validation of the schema. Supported values are _true_ or _false_.                                                                                                                                                                                                                      | :x:                | true    |\n| createDiff      | Enabled or disables creation of diff to previous schema version. Supported values are _true_ or _false_.                                                                                                                                                                                                   | :x:                | true    |\n| token           | A GitHub token used to authenticate API access for obtaining the most recent release. This argument is only mandatory, if createDiff is _true_.                                                                                                                                                            | :x:                | -       |\n| previousVersion | The previous version/tag name to apply the diff against. This argument's value must be determined in an upstream action and should have a variable name as value, e.g., ${{ steps.determine-previous-version.outputs.version }}. Using this argument is only recommended for experts and in special cases. | :x:                | -       |\n\nIf configured correctly, the action will now run on each build for pull requests\nto the main branch. You may modify the configuration according to your needs.\n\n\u003e [!IMPORTANT]  \n\u003e The action automatically selects the schema validator based on the URL given\n\u003e by the _$schema_ attribute. Currently, schema version draft-07, 2019-09, and\n\u003e 2020-12 are supported. While for 2019-09 and 2020-12 the https schema URLs are\n\u003e supported by the validator, for using schema draft-07 _$schema_ must be set to\n\u003e [http://json-schema.org/draft-07/schema](http://json-schema.org/draft-07/schema).\n\u003e If no _$schema_ attribute is found, the draft-07 validator is used.\n\nFor the first run, i.e., if your schema is not released, yet, you'll see a\nmessage in the diff report, that no previous version could be obtained. In order\nto allow the action to obtain it for an existing release, another CI workflow is\nneeded:\n\n```yaml\nname: Run on New Release\n\non:\n  release:\n    types: [published] # Triggers only when a release is published\n\njobs:\n  on-release-job:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v4\n      - name: JSON Schema Check\n        uses: kit-data-manager/json-schema-check-action@v0.0.4\n        with:\n          schemaPath: 'schema.json'\n          token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nAs you can see, the action can also be used on another trigger, which is the\npublication of a new release. The purpose of this workflow is to publish the\nschema as release artifact, such that it can be accessed directly instead of\nchecking out the code of a tagged version. Another advantage is, that this\naction call creates a bundled schema, i.e., it resolves $ref elements in the\nschema file, which could also be helpful for the schema applicability as some\ntools cannot work with $refs very well. As a result, your release will contain a\nfile _bundled-\u003cTAG\u003e.json_, which is expected by this action for creating the\ndiff to the previous release. If the file was found, i.e., if at least one\nrelease exists which has a file _bundled-\u003cTAG\u003e.json_ attached, you'll see the\nfollowing summary after each action run:\n\n---\n\n## JSON Schema Check Results\n\n### Validate JSON Schema\n\n:white_check_mark: The schema is valid JSON.\n\n### Diff to Latest Release\n\n```diff\n {\n   properties: {\n     name: {\n-      description: \"user name\"\n+      description: \"Name of the user.\"\n     }\n     rating: {\n-      description: \"Workshop rating from 1 to 5\"\n+      description: \"Workshop rating from 0 to 5\"\n-      minimum: 1\n+      minimum: 0\n     }\n     feedback: {\n-      maxLength: 512\n+      maxLength: 256\n     }\n   }\n }\n```\n\n\u003e [!TIP] To check schema backwards compatibility, you may use any AI provider\n\u003e with a prompt like:\n\u003e\n\u003e **Assuming I have two JSON schemas, both are different according to the\n\u003e following diff, are both schemas compatible? \u003cPASTE_DIFF_HERE\u003e**\n\u003e\n\u003e If you like, you may add additional rendering instructions, e.g.:\n\u003e\n\u003e **Render the result as table showing the changed attributes, a columns to\n\u003e check backward compatibility, and a column to provide comments on why a\n\u003e certain property is not backwards compatible.**\n\n---\n\nFor further analysis of backwards compatibility, you may follow the tip at the\nend. Putting the shown example in ChatGPT will bring the following result:\n\n| **Property** | **Attribute Changed**  | **Backward Compatible?** | **Comments**                                                                               |\n| ------------ | ---------------------- | ------------------------ | ------------------------------------------------------------------------------------------ |\n| `name`       | `description`          | ✅ Yes                   | Description text change only; no effect on validation.                                     |\n| `rating`     | `description`          | ✅ Yes                   | Description updated to match the new validation rule; not used for validation.             |\n| `rating`     | `minimum: 1 ➝ 0`       | ✅ Yes                   | New schema accepts more values (0 is now valid); existing values (1–5) remain valid.       |\n| `feedback`   | `maxLength: 512 ➝ 256` | ❌ No                    | New schema restricts `feedback` to 256 chars; values between 257–512 would now be invalid. |\n\nAs you can see, the change of the _feedback_ attribute will break backwards\ncompatibility, while all other changes keep compatibility. As a result, you may\noffer some kind of migration or mapping between the previous schema version and\nthe new version and according to semantic versioning rules, the next version\nwill be a major release.\n\n### Using a custom token\n\nFor the token argument you should typically use the value\n_${{ secrets.GITHUB_TOKEN }}_, as this is the automatically generated token\nintended to be used in CI workflows.\n\nAlternatively, you can use your own token. Details on how to create GitHub\naccess tokens can be\n[found here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).\nFor our purposes, **read** permissions to contents will be sufficient. Once\ncreated, you have to make the created GitHub access token available to your\nworkflow actions. Details on how to do this can be\n[found here](https://docs.github.com/de/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).\nAfterward, you can use your token via _${{ secrets.YOUR_TOKEN_NAME }}_.\n\n## License\n\nThis software is licensed under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkit-data-manager%2Fjson-schema-check-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkit-data-manager%2Fjson-schema-check-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkit-data-manager%2Fjson-schema-check-action/lists"}