Using Bowtie in GitHub Actions#
Bowtie can be used from within GitHub Actions by using it in a GitHub workflow step. For example:
name: Run Bowtie
on: [push]
jobs:
bowtie:
runs-on: ubuntu-latest
steps:
- name: Install Bowtie
uses: bowtie-json-schema/bowtie@v2023.08.9
You will likely wish to use the latest version of Bowtie available.
Once you have installed it, the Bowtie CLI will be available in successive run steps. Most commonly, you can use it to validate an instance (some data) using a specific JSON Schema implementation by adding:
- name: Validate Schema
run: bowtie validate -i lua-jsonschema schema.json instance.json
replacing lua-jsonschema
and the filenames with your implementation and schema of choice.
For full details on the commands available, see the CLI documentation.
A fully working example of the above code can also be found here.