{"id":18604791,"url":"https://github.com/bowtie-json-schema/github-actions-example","last_synced_at":"2025-11-02T11:30:23.808Z","repository":{"id":176235430,"uuid":"654848744","full_name":"bowtie-json-schema/github-actions-example","owner":"bowtie-json-schema","description":"A test repository for demonstrating the use of Bowtie via GitHub Actions","archived":false,"fork":false,"pushed_at":"2023-07-19T13:20:57.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-26T23:41:51.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bowtie-json-schema.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-17T05:58:28.000Z","updated_at":"2023-08-16T15:46:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"aca3a36d-7410-4486-8806-73a472a4f9dd","html_url":"https://github.com/bowtie-json-schema/github-actions-example","commit_stats":null,"previous_names":["vishrutaggarwal/bowtie-actions-example","bowtie-json-schema/github-actions-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowtie-json-schema%2Fgithub-actions-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowtie-json-schema%2Fgithub-actions-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowtie-json-schema%2Fgithub-actions-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowtie-json-schema%2Fgithub-actions-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bowtie-json-schema","download_url":"https://codeload.github.com/bowtie-json-schema/github-actions-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394720,"owners_count":19631121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-07T02:18:59.982Z","updated_at":"2025-11-02T11:30:23.753Z","avatar_url":"https://github.com/bowtie-json-schema.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# bowtie-actions-example\nA test repository for documenting bowtie in GitHub Actions.\n\n\n\n## Documentation outline\n---\n\n- Setup bowtie\n  - Initial Steps\n  - Verification Steps\n- Validate using bowtie\n  - Add the `validate` Command\n  - Change the Dialect\n  - Use Multiple Implementations\n\n\u003cbr\u003e\n\n### Setup bowtie\n---\n\n#### 1. **Initial Steps** \n\n- Create `.github/workflows' directory in your repository.\n- Create a file with `.yml` extension.\n- Enter the following code in the YAML file:\n\n```yaml\nname: Setup Bowtie\nrun-name: ${{ github.actor }} is learning to use Bowtie\n\non: [push]\n\njobs:\nsets-up-bowtie:\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Install Bowtie\n      uses: bowtie-json-schema/bowtie@v2023.05.12\n```\n\n_This will install bowtie every time you push onto the repository._\n\n#### 2. **Verification Steps**\n\n- Append the following code in the already created YAML file:\n```yaml\n      - name: Run Bowtie\n        run: bowtie --version\n```\n\n- The YAML file will look something like this: \n```yaml\nname: Setup Bowtie\nrun-name: ${{ github.actor }} is learning to use Bowtie\n\non: [push]\n\njobs:\n  sets-up-bowtie:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Install Bowtie\n        uses: bowtie-json-schema/bowtie@v2023.05.12\n\n      - name: Run Bowtie\n        run: bowtie --version\n```\n\n- Push the changes to your repository.\n- Go to the `Actions` tab of your repository and wait for the action to complete.\n- If the run was successful, you will see a green circle with a tick.\n- Click on the Workflow and then click on the ` sets-up-bowtie` Job.\n- Open the drop down of the `Run Bowtie` step.\n- If it shows something like this, bowtie is running successfully: \n```bash\nbowtie, version 2023.6.4\n```\n\n\u003e IF THE RUN WAS NOT SUCCESSFUL, YOU WILL SEE A RED CIRCLE WITH A CROSS. RECHECK THE CODE YOU HAVE WRITTEN, AND CORRECT IN CASE OF ANY DISCREPANCY.\n\n_This will help us to test if bowtie is working in the GitHub action._\n\n\u003cbr\u003e\n\n### Validate using bowtie\n---\n\nNow that you have successfully added bowtie to your workflow, let's work on using it to validate your JSON Specifications.\n\n#### 1. **Add the `validate` Command**\n\n- Add the following code snippet to your YAML file:\n```yaml\n      - name: Validate Schema\n        run: bowtie validate -i lua-jsonschema schema.json instance.json\n```\nLet's break down this command:\n\n- `bowtie validate`: It tells which command to run.\n- `-i`: It is a required flag for `validate` command and specifies which implementation to be used, which in this case is `lua-jsonschema`.\n- `schema.json`: It is the name of the file containing the defined schema against which instances will be validated.\n- `instance.json`: It is the name of the file containing the instances to be validated.\n\u003c!-- [Please note that this can also be a directory.]--\u003e\n\n_You will see that the implementation is skipped and thus does not validate the instances. This is because the lua implementation does not support the default 2020-12 draft._\n\n#### 2. **Change the Dialect**\n\n- To change the dialect used by the implementation, change the validate command to this:\n```yaml\n      - name: Validate Schema\n        run: bowtie validate -i lua-jsonschema --dialect 7 schema.json instance.json\n```\n_This will change the dialect used to draft 7 instead of the default 2020-12._\n\n#### 3. **Use Multiple Implementations**\n\n- You might require using two or more different implementations for the same schema and instances. This is how you can get it done:\n```yaml\n      - name: Validate Schema\n        run: bowtie validate -i lua-jsonschema -i python-jsonschema schema.json instance.json\n```\n_Here we have used just two implementations, namely: python and lua. You may make changes according to your requirements._\n\n\u003cbr\u003e\n\n_Note that you cannot use different dialects for different implementations in the same command, bowtie just takes the last dialect specified by using the `--dialect` flag._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbowtie-json-schema%2Fgithub-actions-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbowtie-json-schema%2Fgithub-actions-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbowtie-json-schema%2Fgithub-actions-example/lists"}