mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-03-21 17:24:28 -05:00
Check Trello list names for valid boards
This commit is contained in:
parent
10ac3de62d
commit
17d404870f
|
|
@ -16,14 +16,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"7q78sWW2": {
|
||||
"github_links": [
|
||||
{
|
||||
"display": "eShop repo",
|
||||
"url": "https://github.com/PretendoNetwork/Grove"
|
||||
}
|
||||
]
|
||||
},
|
||||
"lmAbWUyn": {
|
||||
"github_links": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ const got = require('got');
|
|||
const config = require('../config.json');
|
||||
|
||||
const trello = new Trello(config.trello.api_key, config.trello.api_token);
|
||||
const VALID_LIST_NAMES = ['Not Started', 'Started', 'Completed'];
|
||||
let cache;
|
||||
|
||||
async function getTrelloCache() {
|
||||
|
|
@ -49,6 +50,14 @@ async function updateTrelloCache() {
|
|||
meta.id = board.shortLink;
|
||||
|
||||
const lists = await trello.getListsOnBoard(board.id);
|
||||
|
||||
const listNames = lists.map(list => list.name);
|
||||
const hasAllValidLists = listNames.every(name => VALID_LIST_NAMES.includes(name));
|
||||
|
||||
if (!hasAllValidLists) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const cards = await trello.getCardsOnBoard(board.id);
|
||||
|
||||
for (const card of cards) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user