Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add json schema #29

Merged
merged 10 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/publish-json-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish JSON schema
on:
push:
paths:
- 'config/lassie.schema.json'
anbraten marked this conversation as resolved.
Show resolved Hide resolved
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.4

- name: Remove all files except lassie.schema.json
working-directory: config
run: find . -mindepth 1 -maxdepth 1 ! -name "lassie.schema.json" -delete

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: config
clean: false
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Lassie can be controlled with a config file. To enable lassie for a project you

```json5
{
"$schema": "https://geprog.github.io/lassie-bot-dog/lassie.schema.json",
lukashass marked this conversation as resolved.
Show resolved Hide resolved
"plugins": {
"auto_merge": {
"squash": true,
Expand Down
38 changes: 38 additions & 0 deletions config/lassie.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON schema for Lassie config files (https://github.com/geprog/lassie-bot-dog)",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string"
},
"plugins": {
"description": "Define configurations for all available plugins",
"type": "object",
"additionalProperties": false,
"properties": {
"auto_merge": {
"description": "Configuration for the auto_merge plugin",
"type": "object",
"additionalProperties": false,
"properties": {
"squash": {
"description": "Whether or not to squash the merge request when merging",
"type": "boolean"
},
"neededLabels": {
"description": "Labels needed for merge request to be ready for auto merging",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
}
}
}
}
}
}