Skip to content

Commit

Permalink
fix workflow, schema required fix #patch (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
psprings authored Mar 24, 2021
1 parent 6a9ede3 commit 7c9cc5d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@ with:
path: './some/path/to/file.yaml'
```
## CLI usage
```
usage: okv [-h] [-path [PATH]] [-s SCHEMA] [-n CPU_NUM] [-p PARSER] [--no-strict] [--no-error] [--ok OK]

Validate yaml files.

optional arguments:
-h, --help show this help message and exit
-path [PATH] folder to validate. Default is current directory.
-s SCHEMA, --schema SCHEMA
filename of schema. Default is schema.yaml.
-n CPU_NUM, --cpu-num CPU_NUM
number of CPUs to use. Default is 4.
-p PARSER, --parser PARSER
YAML library to load files. Choices are "ruamel" or "pyyaml" (default).
--no-strict Disable strict mode, unexpected elements in the data will be accepted.
--no-error Ignore error when violation of schema is identified.
--ok OK This indicates which Open Know specification to use.
```

## Docker

### Usage

The Docker image accepts all of the [CLI arguments as detailed above](#cli-usage).

```
docker run --rm -v ${PWD}/:/tmp/ ok-validate --ok=okh -path=/tmp/path/to/okh-file.yaml
```

## Automatic releasing

<https://github.com/anothrNick/github-tag-action#bumping>
Expand Down
9 changes: 3 additions & 6 deletions okv/schemas/okh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

# Manifest metadata

# ps, we're keeping regex errors for emails + url whether they're required or not bc of web dev things ~ sea
# this has both project link and doc home in it
date-created: day()
date-updated: day()
manifest-author:
Expand Down Expand Up @@ -40,7 +38,7 @@ health-safety-notice: str(required=False) # paragraph

contact: include('contact-kit', required=False) # currently listed as required,

contributors: list(include('nonessential-contact'),required=False) # recommended
contributors: list(include('nonessential-contact'), required=False) # recommended

image: regex('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+((.gif)|(.png)|(.jpg)|(.jpeg))$', name="valid image url", required=False)
version: str(required=False) # text
Expand Down Expand Up @@ -105,7 +103,7 @@ standards-used:
standard-title: str() # Required where used | Title of the standard used in developing the design or documentation
publisher: str(required=False) # Publisher of the standard
reference: str(required=False) # Reference indentifier of the standard (e.g. ISO 9001)
certification: list(include('certification', required=False))
certification: list(include('certification'), required=False)

list-item:
path: include('url-type', required=False)
Expand All @@ -122,8 +120,7 @@ contact-kit:
email: regex('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$', required=False)
social: list(include('social-list-item'), required=False)

license-item: any(include('license-item-a'), include('license-item-b'),include('license-item-c'))
# if there's a more optimized way to do that pls lmk ~ SEA
license-item: any(include('license-item-a'), include('license-item-b'), include('license-item-c'))
---
# {license-list} is not a map comes from here
license-item-a:
Expand Down

0 comments on commit 7c9cc5d

Please sign in to comment.