Skip to content

Commit c8a6e15

Browse files
committed
qa: introduce yam schema validation
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent dc0b223 commit c8a6e15

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: validate tools yaml
2+
3+
on:
4+
pull_request:
5+
paths: [ "tools.yml", "tools.schema.yaml", ".github/workflows/validate_tools_yaml.yml" ]
6+
push:
7+
paths: [ "tools.yml", "tools.schema.yaml", ".github/workflows/validate_tools_yaml.yml" ]
8+
workflow_dispatch:
9+
10+
permissions: read-all
11+
12+
jobs:
13+
lint-yaml:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: install yamale
17+
run: pip install 'yamale>=5.2.1,<6'
18+
- name: checkout
19+
uses: actions/checkout@v4
20+
- name: lint tools yaml
21+
run: yamale -s tools.schema.yaml tools.yml
22+

tools.schema.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# yamale schema syntax: https://github.com/23andMe/Yamale#schema
2+
list(include('tool'))
3+
4+
---
5+
6+
tool:
7+
name: str()
8+
publisher: str()
9+
description: str() # all after 250 chars is truncated
10+
repoUrl: str(required=False)
11+
websiteUrl: str(matches='^https?://.+')
12+
categories: list(include('category'))
13+
14+
# see tool-categories.yml
15+
category: >
16+
enum(
17+
'opensource',
18+
'proprietary',
19+
'build-integration',
20+
'analysis',
21+
'author',
22+
'github-action',
23+
'github-app',
24+
'transform',
25+
'library',
26+
'signing-notary',
27+
'distribute'
28+
)
29+

0 commit comments

Comments
 (0)