diff options
| author | Wolfgang Walther <walther@technowledgy.de> | 2025-11-06 09:53:24 +0100 |
|---|---|---|
| committer | Wolfgang Walther <walther@technowledgy.de> | 2025-11-06 09:53:29 +0100 |
| commit | c4548e58fb8fd76f6565734b11c74f73ea0c6b07 (patch) | |
| tree | b60b6af6098b85d3b31d78e352ebfa9465cc23ce /ci | |
| parent | f095a1f2f0f6ed306a6dbd13a47edab08a386dc0 (diff) | |
ci/github-script/bot: fix scheduled bot with older artifacts
We only recently introduced the owners.txt file to the comparison
artifact, so once the bot runs on a schedule it will it older artifacts
very quickly - and then can't find the owners file.
We can fallback to an empty owners list in this case, because an older
artifact also means an older workflow run previously, so this will have
pinged owners already.
Diffstat (limited to 'ci')
| -rw-r--r-- | ci/github-script/bot.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ci/github-script/bot.js b/ci/github-script/bot.js index 1b807b30ec7d..c66a91583140 100644 --- a/ci/github-script/bot.js +++ b/ci/github-script/bot.js @@ -375,6 +375,17 @@ module.exports = async ({ github, context, core, dry }) => { }) if (!pull_request.draft) { + let owners = [] + try { + // TODO: Create owner map similar to maintainer map. + owners = (await readFile(`${pull_number}/owners.txt`, 'utf-8')).split( + '\n', + ) + } catch (e) { + // Older artifacts don't have the owners.txt, yet. + if (e.code !== 'ENOENT') throw e + } + // We set this label earlier already, but the current PR state can be very different // after handleReviewers has requested reviews, so update it in this case to prevent // this label from flip-flopping. @@ -392,10 +403,7 @@ module.exports = async ({ github, context, core, dry }) => { await readFile(`${pull_number}/maintainers.json`, 'utf-8'), ), ).map((id) => parseInt(id)), - // TODO: Create owner map similar to maintainer map. - owners: (await readFile(`${pull_number}/owners.txt`, 'utf-8')).split( - '\n', - ), + owners, getTeamMembers, getUser, }) |
