Skip to content

Commit

Permalink
Update check.js (#2994)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm1957 authored Nov 25, 2023
1 parent e34a9d4 commit 99ff8b5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@ async function doIt() {
return Promise.reject('Cannot find PR');
}

const files = await getGithub(`https://api.github.com/repos/ioBroker/ioBroker.repositories/pulls/${prID}/files`);
let fileNames = [];
files.forEach( f=>{fileNames.push(f.filename)});

console.log('Files changed:');
fileNames.forEach( f=>{console.log(` ${f}`)});

const isLatest = fileNames.includes('sources-dist.json');
const isStable = fileNames.includes('sources-dist-stable.json')

const links = await detectAffectedAdapter(prID);
const comments = [{text: TEXT_COMMENT_TITLE}];
let someChecked = false;
Expand Down Expand Up @@ -322,9 +332,11 @@ async function doIt() {
}
}

comments.push({text:`\n`, noDecorate: true});
comments.push({text:`Adapter releases: https://www.iobroker.dev/adapter/${adapterName}/releases\n`, noDecorate: true});
comments.push({text:`Adapter statistic: https://www.iobroker.dev/adapter/${adapterName}/statistics\n`, noDecorate: true});
if (isStable) {
comments.push({text:`\n`, noDecorate: true});
comments.push({text:`Adapter releases: https://www.iobroker.dev/adapter/${adapterName}/releases\n`, noDecorate: true});
comments.push({text:`Adapter statistic: https://www.iobroker.dev/adapter/${adapterName}/statistics\n`, noDecorate: true});
}
}
if (!someChecked) {
comments.push({text: 'No changed adapters found', noDecorate: true});
Expand Down

0 comments on commit 99ff8b5

Please sign in to comment.