From 99ff8b56848e3553c08e2c0feb915ec4a59a1490 Mon Sep 17 00:00:00 2001 From: Martin M Date: Sat, 25 Nov 2023 17:51:06 +0100 Subject: [PATCH] Update check.js (#2994) --- lib/check.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/check.js b/lib/check.js index cef0241c5..8a04c2db5 100644 --- a/lib/check.js +++ b/lib/check.js @@ -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; @@ -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});