From f46f3f43affb664ad73a1a69a865920053914189 Mon Sep 17 00:00:00 2001 From: James King <james@jamesking56.uk> Date: Thu, 18 Oct 2018 11:28:02 +0100 Subject: [PATCH] fix(composer): Add GitLab token to composer. (#2661) Closes #2660 --- lib/manager/composer/artifacts.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/manager/composer/artifacts.js b/lib/manager/composer/artifacts.js index 9cefb21a3a..2936a58006 100644 --- a/lib/manager/composer/artifacts.js +++ b/lib/manager/composer/artifacts.js @@ -39,17 +39,25 @@ async function getArtifacts( if (!config.gitFs) { await fs.outputFile(localLockFileName, existingLockFileContent); } - let authJson; - const credentials = hostRules.find({ + let authJson = {}; + let credentials = hostRules.find({ platform: 'github', host: 'api.github.com', }); // istanbul ignore if if (credentials && credentials.token) { - authJson = { - 'github-oauth': { - 'github.com': credentials.token, - }, + authJson['github-oauth'] = { + 'github.com': credentials.token, + }; + } + credentials = hostRules.find({ + platform: 'gitlab', + host: 'gitlab.com', + }); + // istanbul ignore if + if (credentials && credentials.token) { + authJson['gitlab-token'] = { + 'gitlab.com': credentials.token, }; } try { -- GitLab