Skip to content

Commit aba0ab0

Browse files
committed
update lint file
1 parent 7c6aba4 commit aba0ab0

6 files changed

+146
-40
lines changed

.github/workflows/get_data_lint_files_deploy.yml

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ jobs:
6565
- name: Prepare data files for GPTs
6666
run: node utils/js/create_data_for_gpts.js
6767

68+
- name: Ensure change logs are updated
69+
if: github.base_ref == 'main' || github.ref == 'refs/heads/main'
70+
run: node utils/js/ensure_changelog_update.js
71+
6872
- name: Set lint-fix branch name
6973
id: vars
7074
shell: bash

utils/js/changelog_versions.js

-39
This file was deleted.

utils/js/ensure_changelog_update.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import * as fs from "fs";
2+
import * as path from "path";
3+
4+
import axios from "axios";
5+
6+
const versionsFromJson = JSON.parse(fs.readFileSync("./utils/_changeLogVersions.json", 'utf8'));
7+
8+
const komodoLatestReleaseURL = "https://api.github.com/repos/komodoplatform/komodo/releases/latest"
9+
10+
const komodoDefiFrameworkLatestReleaseURL = "https://api.github.com/repos/komodoplatform/komodo-defi-framework/releases/latest"
11+
12+
async function fetchLatestRelease() {
13+
try {
14+
const komodoResponse = await axios.get(komodoLatestReleaseURL);
15+
if(komodoResponse.data.tag_name === versionsFromJson['komodo']){
16+
console.log("komodo changelog is upto date");
17+
} else {
18+
throw new Error("update komodo changelog in the file: ./src/pages/smart-chains/changelog/index.mdx and the release version in ./utils/_changeLogVersions.json")
19+
}
20+
} catch (error) {
21+
console.error('Error when comparing the komodo latest release info:', error);
22+
}
23+
24+
25+
try {
26+
const defiResponse = await axios.get(komodoDefiFrameworkLatestReleaseURL);
27+
if(defiResponse.data.tag_name === versionsFromJson['komodo-defi-framework']){
28+
console.log("komodo-defi-framework changelog is upto date");
29+
} else {
30+
throw new Error("update komodo changelog in the file: ./src/pages/atomicdex/changelog/index.mdx and the release version in ./utils/_changeLogVersions.json")
31+
}
32+
} catch (error) {
33+
console.error('Error when comparing the komodo defi framework latest release:', error);
34+
}
35+
}
36+
37+
38+
(async function() {
39+
await fetchLatestRelease()
40+
})()

utils/js/package-lock.json

+100
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/js/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"devDependencies": {
1414
"@sindresorhus/slugify": "^2.2.1",
1515
"acorn": "^8.10.0",
16+
"axios": "^1.6.7",
1617
"mdx-annotations": "^0.1.3",
1718
"remark": "^14.0.3",
1819
"remark-gfm": "^3.0.1",

utils/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ cd ../../
88
node utils/js/get_file_author_data.js
99
node utils/js/validate_update_internal_links_userpass.js
1010
node utils/js/file_presence_structure_checker.js
11-
node utils/js/changelog_versions.js
1211
node utils/js/h1_presence_checker.js
12+
node utils/js/ensure_changelog_update.js

0 commit comments

Comments
 (0)