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

qa: introduce yaml schema validation #1

Merged
merged 1 commit into from
Dec 20, 2024
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
22 changes: 22 additions & 0 deletions .github/workflows/validate_tools_yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: validate tools yaml

on:
pull_request:
paths: [ "tools.yml", "tools.schema.yaml", ".github/workflows/validate_tools_yaml.yml" ]
push:
paths: [ "tools.yml", "tools.schema.yaml", ".github/workflows/validate_tools_yaml.yml" ]
workflow_dispatch:

permissions: read-all

jobs:
lint-yaml:
runs-on: ubuntu-latest
steps:
- name: install yamale
run: pip install 'yamale>=5.2.1,<6'
- name: checkout
uses: actions/checkout@v4
- name: lint tools yaml
run: yamale -s tools.schema.yaml tools.yml

29 changes: 29 additions & 0 deletions tools.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# yamale schema syntax: https://github.com/23andMe/Yamale#schema
list(include('tool'))

---

tool:
name: str()
publisher: str()
description: str() # all after 250 chars is truncated
repoUrl: str(required=False)
websiteUrl: str(matches='^https?://.+')
categories: list(include('category'))

# see tool-categories.yml
category: >
enum(
'opensource',
'proprietary',
'build-integration',
'analysis',
'author',
'github-action',
'github-app',
'transform',
'library',
'signing-notary',
'distribute'
)

Loading