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

test #13

Merged
merged 6 commits into from
Oct 14, 2024
Merged

test #13

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
28 changes: 19 additions & 9 deletions .github/scripts/validate-and-merge.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,12 @@ async function validateAndMerge() {
const content = Buffer.from(fileContent.content, 'base64').toString('utf-8');

// Parse all YAML documents in the file
const yamlDocuments = yaml.loadAll(content);
const yamlDocuments = yaml.load(content);

for (const document of yamlDocuments) {
const isValid = requiredKeys.every(key => key in document);

const isValid = validateSubdocument(document);
if (!isValid) {
console.log('Added object does not contain all required keys');
return;
}

if (!Array.isArray(document.categories) || document.categories.length === 0) {
console.log('Categories must be a non-empty array');
console.log(`Invalid subdocument: ${JSON.stringify(document)}`);
return;
}
}
Expand All @@ -88,4 +82,20 @@ async function validateAndMerge() {
}
}

function validateSubdocument(subdocument) {
const isValid = requiredKeys.every(key => key in subdocument);

if (!isValid) {
console.log(`Subdocument is missing required keys: ${JSON.stringify(subdocument)}`);
return false;
}

if (!Array.isArray(subdocument.categories) || subdocument.categories.length === 0) {
console.log('Categories must be a non-empty array');
return false;
}

return true;
}

validateAndMerge();
33 changes: 0 additions & 33 deletions node_modules/.yarn-integrity

This file was deleted.

11 changes: 11 additions & 0 deletions programs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,14 @@
- NFT Marketplace
- Nft Launchpad
- Nft infra

- name: test
description: test
repo: https://github.com/blobscriptions/blobscriptions
icon: https://blobscriptions.xyz/blobscriptions-logo.png
framework: NextJS
program_address: "sfsd"
categories:
- NFT Marketplace
- Nft Launchpad
- Nft infra
Loading