Check Trello list names for valid boards

This commit is contained in:
Jonathan Barrow 2022-06-09 16:50:52 -04:00
parent 10ac3de62d
commit 17d404870f
2 changed files with 9 additions and 8 deletions

View File

@ -16,14 +16,6 @@
}
]
},
"7q78sWW2": {
"github_links": [
{
"display": "eShop repo",
"url": "https://github.com/PretendoNetwork/Grove"
}
]
},
"lmAbWUyn": {
"github_links": [
{

View File

@ -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) {