mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 04:22:01 -08:00
Update update-set-implementation-lists.yml
This commit is contained in:
parent
a719fe62a9
commit
6e7b74205f
1 changed files with 28 additions and 5 deletions
|
|
@ -34,17 +34,40 @@ jobs:
|
|||
|
||||
const setsData = fs.readFileSync(path.join('Utils', 'mtg-sets-data.txt'), 'utf8')
|
||||
.split('\n')
|
||||
.map(line => ({[line.split('|')[1]]: line.split('|')[0]}));
|
||||
|
||||
console.log(setsData);
|
||||
|
||||
.map(line => line.split('|'));
|
||||
const cardsData = fs.readFileSync(path.join('Utils', 'mtg-cards-data.txt'), 'utf8')
|
||||
.split('\n')
|
||||
.map(line => line.split('|'));
|
||||
|
||||
const issues = await github.paginate(github.rest.issues.listForRepo, {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: 'tracking set'
|
||||
});
|
||||
|
||||
console.log("Found list of existing issues:", issues);
|
||||
|
||||
const issuesToUpdate = [];
|
||||
const issuesToCreate = [];
|
||||
|
||||
setsData.forEach(set => {
|
||||
let foundIssue = undefined;
|
||||
issues.forEach(issue => {
|
||||
if(issue && issue.title && issue.title.startsWith(set[1])) {
|
||||
console.log(`Found tracking issue for ${set[0]} with issue number: ${issue.number}`);
|
||||
foundIssue = issue;
|
||||
break;
|
||||
}
|
||||
});
|
||||
if(foundIssue !== undefined) {
|
||||
issuesToUpdate.push(foundIssue);
|
||||
} else {
|
||||
issuesToCreate.push({
|
||||
title: `${set[1]}: ${set[0]} Set Card Implementation Tracking`,
|
||||
body: `Placeholder`
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log("Issues to update: ", issuesToUpdate);
|
||||
console.log("Issues to create: ", issuesToCreate);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue