Skip to content
Snippets Groups Projects
Commit 861cce01 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

feat: detect/print renovate version

parent 0b89e13d
Loading
......@@ -100,6 +100,7 @@ async function initRepo({
localDir,
}) {
logger.debug(`initRepo("${repository}")`);
logger.info('Using renovate version: ' + global.renovateVersion);
const opts = hostRules.find({ platform: 'github' }, { token, endpoint });
if (!opts.token) {
throw new Error(`No token found for GitHub repository ${repository}`);
......
......@@ -45,6 +45,7 @@ async function start() {
config.global[key] = config[key];
delete config[key];
});
detectRenovateVersion();
// Iterate through repositories sequentially
for (const repository of config.repositories) {
const repoConfig = getRepositoryConfig(config, repository);
......@@ -57,6 +58,15 @@ async function start() {
}
}
// istanbul ignore next
function detectRenovateVersion() {
try {
global.renovateVersion = require('../../../package.json').version; // eslint-disable-line global-require
} catch (err) {
logger.debug({ err }, 'Error getting renovate version');
}
}
function getRepositoryConfig(globalConfig, repository) {
const repoConfig = configParser.mergeChildConfig(
globalConfig,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment