renovate/lib/workers/repository/result.js
2019-03-05 08:00:56 +01:00

30 lines
589 B
JavaScript

module.exports = {
processResult,
};
function processResult(config, res) {
const disabledStatuses = [
'archived',
'blocked',
'cannot-fork',
'disabled',
'forbidden',
'fork',
'no-package-files',
'renamed',
'uninitiated',
'empty',
];
let status;
// istanbul ignore next
if (disabledStatuses.includes(res)) {
status = 'disabled';
} else if (config.repoIsOnboarded) {
status = 'enabled';
} else if (config.repoIsOnboarded === false) {
status = 'onboarding';
} else {
status = 'unknown';
}
return { res, status };
}