diff --git a/README.md b/README.md index d0347de4..9e6af84a 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ See the `README.md` in each directory. - [generate-changelog](./generate-changelog/README.md) - [get-modified-packages](./get-modified-packages/README.md) - [get-self-packages](./get-self-packages/README.md) +- [json-schema-check](./json-schema-check/README.md) - [pre-commit](./pre-commit/README.md) - [register-autonomoustuff-repository](./register-autonomoustuff-repository/README.md) - [remove-exec-depend](./remove-exec-depend/README.md) diff --git a/json-schema-check/README.md b/json-schema-check/README.md new file mode 100644 index 00000000..f0e1b0da --- /dev/null +++ b/json-schema-check/README.md @@ -0,0 +1,29 @@ +# json-schema-check + +## Description + +This action checks if the ROS 2 parameter files (`config/*.param.yaml`) of packages comply with the format of their template JSON Schema file (`schema/*.schema.json`). + +## Usage + +```yaml +jobs: + json-schema-check: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Run json-schema-check + uses: autowarefoundation/autoware-github-actions/json-schema-check@v1 +``` + +## Inputs + +None. + +## Outputs + +None. diff --git a/json-schema-check/action.yaml b/json-schema-check/action.yaml new file mode 100644 index 00000000..9a5c89c1 --- /dev/null +++ b/json-schema-check/action.yaml @@ -0,0 +1,15 @@ +name: json-schema-check +description: "" + +runs: + using: composite + steps: + - name: Install JSON Schema packages + run: | + pip3 install -U check-jsonschema + shell: bash + + - name: Check configuration files + run: | + find -wholename '*/schema/*.schema.json' -execdir bash -c 'check-jsonschema --schemafile "$1" ../config/*.param.yaml' bash '{}' + + shell: bash