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

CIP-0010 | Validation by GitHub workflow #837

Merged
merged 6 commits into from
Jul 14, 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
30 changes: 30 additions & 0 deletions .github/workflows/cip10-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CIP-10 - Validate Registry JSON on Pull Request

on:
pull_request:
paths:
- 'CIP-0010/registry.json'

jobs:
approve: # Pre-approval step
runs-on: ubuntu-latest
steps:
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.

validate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '21'

- name: Install dependencies
run: npm install ajv-cli

- name: Validate JSON against schema
run: npx ajv validate -s CIP-0010/registry.schema.json -d CIP-0010/registry.json > /dev/null
2 changes: 1 addition & 1 deletion CIP-0010/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"description": "CIP-72: dApp registration & Discovery"
},
{
"transaction_metadataum_label": 1694,
"transaction_metadatum_label": 1694,
"description": "Voltaire - additional metadata for governance, provided in a separate transaction"
},
{
Expand Down
81 changes: 21 additions & 60 deletions CIP-0010/registry.schema.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0010",
"type": "array",
rphair marked this conversation as resolved.
Show resolved Hide resolved
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0010",
"title": "Transaction Metadata Label Registry",
"description": "JSON schema for transaction metadata label registry",
"default": [],
"examples": [
[
{
"transaction_metadatum_label": 1967,
"description": "nut.link metadata oracles registry"
},
{
"transaction_metadatum_label": 1968,
"description": "nut.link metadata oracles data points"
}
]
],
"additionalItems": false,
"description": "JSON schema for transaction metadata label registry",
"type": "array",
"items": {
"$id": "#/items",
"anyOf": [
{
"$id": "#/items/anyOf/0",
"type": "object",
"title": "The first anyOf schema",
"description": "An entry in the transaction metadata label registry",
"default": {},
"examples": [
{
"transaction_metadatum_label": 1967,
"description": "nut.link metadata oracles registry"
}
],
"required": [
"transaction_metadatum_label",
"description"
],
"properties": {
"transaction_metadatum_label": {
"$id": "#/items/anyOf/0/properties/transaction_metadatum_label",
"type": "integer",
"title": "The transaction_metadatum_label number",
"default": 0,
"examples": [
1967
]
},
"description": {
"$id": "#/items/anyOf/0/properties/description",
"type": "string",
"title": "The metadatum label description",
"default": "",
"examples": [
"nut.link metadata oracles registry"
]
}
},
"additionalProperties": true
}
]
"type": "object",
"properties": {
"transaction_metadatum_label": {
"type": "integer",
"minimum": 0
},
"description": {
"type": "string",
"maxLength": 256
}
},
"required": [
"transaction_metadatum_label",
"description"
],
"additionalProperties": false
Ryun1 marked this conversation as resolved.
Show resolved Hide resolved
}
}
}