mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
refactor(repositoryWorker): Separate token from config
This commit is contained in:
parent
e41c44ea77
commit
4eb20e0e57
3 changed files with 6 additions and 6 deletions
|
@ -17,7 +17,7 @@ async function start() {
|
|||
for (let index = 0; index < config.repositories.length; index += 1) {
|
||||
const repoConfig = module.exports.getRepositoryConfig(config, index);
|
||||
repoConfig.logger.info('Renovating repository');
|
||||
await repositoryWorker.renovateRepository(repoConfig);
|
||||
await repositoryWorker.renovateRepository(repoConfig, repoConfig.token);
|
||||
repoConfig.logger.info('Finished repository');
|
||||
}
|
||||
if (config.repositories.length === 0) {
|
||||
|
|
|
@ -28,7 +28,7 @@ async function setNpmrc(config) {
|
|||
}
|
||||
}
|
||||
|
||||
async function initApis(inputConfig) {
|
||||
async function initApis(inputConfig, token) {
|
||||
function getPlatformApi(platform) {
|
||||
if (platform === 'github') {
|
||||
return githubApi;
|
||||
|
@ -42,7 +42,7 @@ async function initApis(inputConfig) {
|
|||
config.api = getPlatformApi(config.platform);
|
||||
await config.api.initRepo(
|
||||
config.repository,
|
||||
config.token,
|
||||
token,
|
||||
config.endpoint,
|
||||
config.logger
|
||||
);
|
||||
|
|
|
@ -10,13 +10,13 @@ module.exports = {
|
|||
renovateRepository,
|
||||
};
|
||||
|
||||
async function renovateRepository(packageFileConfig) {
|
||||
let config = Object.assign({}, packageFileConfig);
|
||||
async function renovateRepository(repoConfig, token) {
|
||||
let config = Object.assign({}, repoConfig);
|
||||
config.errors = [];
|
||||
config.warnings = [];
|
||||
config.logger.trace({ config }, 'renovateRepository');
|
||||
try {
|
||||
config = await apis.initApis(config);
|
||||
config = await apis.initApis(config, token);
|
||||
config = await apis.mergeRenovateJson(config);
|
||||
if (config.enabled === false) {
|
||||
config.logger.debug('repository is disabled');
|
||||
|
|
Loading…
Reference in a new issue