mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-24 15:08:44 -05:00
Add check articles script to Github Actions
This commit is contained in:
parent
4fc9345e5c
commit
fe9b6906c3
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -37,3 +37,5 @@ jobs:
|
|||
run: npm run check-translation-jsons:no-write
|
||||
- name: Check homemade badges
|
||||
run: npm run check-homemade-badges
|
||||
- name: Check articles
|
||||
run: npm run check-articles
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
"check-translation-jsons": "node --experimental-strip-types scripts/check-translation-jsons.ts",
|
||||
"check-translation-jsons:no-write": "node --experimental-strip-types scripts/check-translation-jsons.ts --no-write",
|
||||
"check-homemade-badges": "node --experimental-strip-types scripts/check-homemade-badges.ts",
|
||||
"check-articles": "tsx scripts/check-articles.ts",
|
||||
"refresh-prod-db": "node --experimental-strip-types scripts/refresh-prod-db.ts && cross-env DB_PATH=db-prod.sqlite3 npm run migrate up",
|
||||
"biome:check": "npx @biomejs/biome check .",
|
||||
"biome:fix": "npx @biomejs/biome check --write .",
|
||||
|
|
|
|||
18
scripts/check-articles.ts
Normal file
18
scripts/check-articles.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// validates all articles files in the project are following the correct .md + grey matter format
|
||||
|
||||
import { mostRecentArticles } from "~/features/articles/core/list.server";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
async function main() {
|
||||
await mostRecentArticles(1000);
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => {
|
||||
logger.info("Articles are valid.");
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.error("Error validating articles:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user