Skip to content

Commit 013afab

Browse files
committed
go to yaml
1 parent cf3082f commit 013afab

File tree

3 files changed

+115
-133
lines changed

3 files changed

+115
-133
lines changed

.github/scripts/validate-and-merge.mjs

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { createRequire } from 'module';
22
import fetch from 'node-fetch';
3+
import yaml from 'js-yaml';
4+
35
const require = createRequire(import.meta.url);
46
const fs = require('fs');
57

6-
7-
88
const owner = process.env.REPO_OWNER;
99
const repo = process.env.REPO_NAME;
1010
const pull_number = process.env.PR_NUMBER;
@@ -28,36 +28,51 @@ async function validateAndMerge() {
2828
fetch: fetch,
2929
},
3030
});
31+
3132
try {
3233
const { data: pr } = await octokit.pulls.get({
3334
owner,
3435
repo,
3536
pull_number,
3637
});
3738

38-
const { data: diff } = await octokit.pulls.get({
39+
const { data: files } = await octokit.pulls.listFiles({
3940
owner,
4041
repo,
4142
pull_number,
42-
mediaType: { format: 'diff' }
4343
});
4444

45-
const addedLines = diff.split('\n')
46-
.filter(line => line.startsWith('+') && !line.startsWith('+++'))
47-
.map(line => line.slice(1).trim());
45+
const yamlFile = files.find(file => file.filename.endsWith('.yaml') || file.filename.endsWith('.yml'));
46+
47+
if (!yamlFile) {
48+
console.log('No YAML file found in the PR');
49+
return;
50+
}
4851

49-
const addedContent = JSON.parse(addedLines.join(''));
52+
const { data: fileContent } = await octokit.repos.getContent({
53+
owner,
54+
repo,
55+
path: yamlFile.filename,
56+
ref: pr.head.ref,
57+
});
5058

51-
const isValid = requiredKeys.every(key => key in addedContent);
59+
const content = Buffer.from(fileContent.content, 'base64').toString('utf-8');
60+
61+
// Parse all YAML documents in the file
62+
const yamlDocuments = yaml.loadAll(content);
5263

53-
if (!isValid) {
54-
console.log('Added object does not contain all required keys');
55-
return;
56-
}
64+
for (const document of yamlDocuments) {
65+
const isValid = requiredKeys.every(key => key in document);
5766

58-
if (!Array.isArray(addedContent.categories) || addedContent.categories.length === 0) {
59-
console.log('Categories must be a non-empty array');
60-
return;
67+
if (!isValid) {
68+
console.log('Added object does not contain all required keys');
69+
return;
70+
}
71+
72+
if (!Array.isArray(document.categories) || document.categories.length === 0) {
73+
console.log('Categories must be a non-empty array');
74+
return;
75+
}
6176
}
6277

6378
await octokit.pulls.merge({

programs.json

Lines changed: 0 additions & 117 deletions
This file was deleted.

programs.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
- name: canonical_bridge
2+
description: The Eclipse Canonical Bridge facilitates depositing and withdrawing ether from the Eclipse Chain
3+
repo: https://github.com/Eclipse-Laboratories-Inc/syzygy/tree/main/solana-programs/canonical_bridge
4+
icon: https://i.imgur.com/y0JEPfQ.png
5+
framework: Anchor
6+
program_address: br1xwubggTiEZ6b7iNZUwfA3psygFfaXGfZ1heaN9AW
7+
categories:
8+
- Bridge
9+
10+
- name: Lifinity
11+
description: The first oracle-based DEX on Eclipse, designed to improve capital efficiency and reduce impermanent loss.
12+
repo: https://github.com/Lifinity-Labs/lifinity-amm-v2-eclipse
13+
icon: https://v1.lifinity.io/logo/LFNTY.svg
14+
framework: Anchor
15+
program_address: LfacfEjtujQTWBXZVzgkiPBw7Mt4guHSsmAi7y3cycL
16+
categories:
17+
- DEX
18+
19+
- name: EclipseGames
20+
description: Support for the creation of mini-games on the Eclipse blockchain
21+
repo: https://github.com/cryptohunter0x1/EclipseGames.git
22+
icon: https://i.imgur.com/YU8jVSb.jpeg
23+
framework: Anchor
24+
program_address: GYLvUjL1JUjFfqVvEK4C8EKFMh93B1ZzrQsQceRDEHeB
25+
categories:
26+
- games
27+
28+
- name: Save
29+
description: save lending protocol
30+
repo: https://github.com/solendprotocol/solana-program-library
31+
icon: https://save.finance/assets/tokens/save.svg
32+
framework: n/a
33+
program_address: So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo
34+
categories:
35+
- borrow
36+
- lend
37+
38+
- name: Orca
39+
description: Orca is the primary liquidity layer of Eclipse where users can quickly, affordably, and reliably transact on a peer-to-peer basis trading or providing liquidity of SPL tokens.
40+
repo: https://github.com/orca-so/whirlpools
41+
icon: https://i.imgur.com/eTO4KwA.png
42+
framework: Anchor
43+
program_address: whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc
44+
categories:
45+
- DEX
46+
47+
- name: Blip Radar
48+
description: Send messages to any wallet
49+
repo: https://github.com/Eclipse-Validators/blip-radar
50+
icon: https://avatars.githubusercontent.com/u/177390705?v=4
51+
framework: Anchor
52+
program_address: rdr1DeFWkwG6nQfammDLTzRT6uW32t7yEHWCmcr49Df
53+
categories:
54+
- NFT
55+
- Messaging
56+
57+
- name: decalls_prediction
58+
description: DeCalls is the ultimate price prediction platform on Eclipse where anyone can wager on whether the price of an asset will rise or fall within a specific period with winners getting all the prize pool
59+
repo: https://github.com/endlesstechjourney/decalls-public
60+
icon: https://github.com/endlesstechjourney/decalls-public/blob/main/DeCalls_logo_white_high.png
61+
framework: Anchor
62+
program_address: DcZMKcjz34CcXF1vx7CkfARZdmEja2Kcwvspu1Zw6Zmn
63+
categories:
64+
- Dapp
65+
66+
- name: decalls_revshare
67+
description: TDeCalls is the ultimate price prediction platform on Eclipse where anyone can wager on whether the price of an asset will rise or fall within a specific period with winners getting all the prize pool
68+
repo: https://github.com/endlesstechjourney/decalls-public
69+
icon: https://github.com/endlesstechjourney/decalls-public/blob/main/DeCalls_logo_white_high.png
70+
framework: Anchor
71+
program_address: ELexZoFHkSHYiAxw1jtY3se8RVPEjsL4HGqD4mfkMreZ
72+
categories:
73+
- Dapp
74+
75+
- name: Blobscriptions
76+
description: Blobscription is a NFT Launchpad and Marketplace that provides infrastructure for a novel open Standard for NFTs and Inscriptions on Data Availability Layers
77+
repo: https://github.com/blobscriptions/blobscriptions
78+
icon: https://blobscriptions.xyz/blobscriptions-logo.png
79+
framework: NextJS
80+
program_address: ""
81+
categories:
82+
- NFT Marketplace
83+
- Nft Launchpad
84+
- Nft infra

0 commit comments

Comments
 (0)