From 6f0ceaecc5eead9e6b8e2aaa2bd56f14b3a44b4f Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Thu, 13 Sep 2018 05:50:16 +0200 Subject: [PATCH] fix(ghe): use full path for github datasource This prevents accidentally querying GHE for things such as Node.js tags. Closes #2518 --- lib/datasource/github.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datasource/github.js b/lib/datasource/github.js index 3344ed68e6..3512506ff5 100644 --- a/lib/datasource/github.js +++ b/lib/datasource/github.js @@ -17,7 +17,7 @@ async function getPreset(pkgName, presetName = 'default') { } let res; try { - const url = `repos/${pkgName}/contents/renovate.json`; + const url = `https://api.github.com/repos/${pkgName}/contents/renovate.json`; res = Buffer.from((await ghGot(url)).body.content, 'base64').toString(); } catch (err) { logger.debug('Failed to retrieve renovate.json from repo'); @@ -50,13 +50,13 @@ async function getPkgReleases(purl, config) { } try { if (options.ref === 'release') { - const url = `repos/${repo}/releases?per_page=100`; + const url = `https://api.github.com/repos/${repo}/releases?per_page=100`; versions = (await ghGot(url, { paginate: true })).body.map( o => o.tag_name ); } else { // tag - const url = `repos/${repo}/tags?per_page=100`; + const url = `https://api.github.com/repos/${repo}/tags?per_page=100`; versions = (await ghGot(url, { cache: process.env.RENOVATE_SKIP_CACHE ? undefined : map, paginate: true, -- GitLab