diff --git a/script/lib/create-windows-installer.js b/script/lib/create-windows-installer.js index 6f5d87c1d..d30c9cd5c 100644 --- a/script/lib/create-windows-installer.js +++ b/script/lib/create-windows-installer.js @@ -7,6 +7,9 @@ const path = require('path'); const CONFIG = require('../config'); +const REPO_OWNER = process.env.REPO_OWNER || 'atom'; +const MAIN_REPO = process.env.MAIN_REPO || 'atom'; + module.exports = packagedAppPath => { const archSuffix = process.arch === 'ia32' ? '' : '-' + process.arch; const updateUrlPrefix = @@ -17,7 +20,7 @@ module.exports = packagedAppPath => { exe: CONFIG.executableName, appDirectory: packagedAppPath, authors: 'GitHub Inc.', - iconUrl: `https://raw.githubusercontent.com/atom/atom/master/resources/app-icons/${ + iconUrl: `https://raw.githubusercontent.com/${REPO_OWNER}/${MAIN_REPO}/master/resources/app-icons/${ CONFIG.channel }/atom.ico`, loadingGif: path.join( diff --git a/script/lib/update-dependency/git.js b/script/lib/update-dependency/git.js index a9f8843fe..26d226a2d 100644 --- a/script/lib/update-dependency/git.js +++ b/script/lib/update-dependency/git.js @@ -1,3 +1,6 @@ +const REPO_OWNER = process.env.REPO_OWNER || 'atom'; +const MAIN_REPO = process.env.MAIN_REPO || 'atom'; + const git = (git, repositoryRootPath) => { const path = require('path'); const packageJsonFilePath = path.join(repositoryRootPath, 'package.json'); @@ -10,7 +13,7 @@ const git = (git, repositoryRootPath) => { if (!err && !remotes.map(({ name }) => name).includes('ATOM')) { git.addRemote( 'ATOM', - `https://atom:${process.env.AUTH_TOKEN}@github.com/atom/atom.git/` + `https://atom:${process.env.AUTH_TOKEN}@github.com/${REPO_OWNER}/${MAIN_REPO}.git/` ); } }); diff --git a/script/lib/update-dependency/pull-request.js b/script/lib/update-dependency/pull-request.js index f10a3540d..a96d87779 100644 --- a/script/lib/update-dependency/pull-request.js +++ b/script/lib/update-dependency/pull-request.js @@ -1,13 +1,16 @@ const { request } = require('@octokit/request'); +const REPO_OWNER = process.env.REPO_OWNER || 'atom'; +const MAIN_REPO = process.env.MAIN_REPO || 'atom'; + const requestWithAuth = request.defaults({ baseUrl: 'https://api.github.com', headers: { 'user-agent': 'atom', authorization: `token ${process.env.AUTH_TOKEN}` }, - owner: 'atom', - repo: 'atom' + owner: REPO_OWNER, + repo: MAIN_REPO }); module.exports = { @@ -28,7 +31,7 @@ module.exports = { }, findPR: async ({ moduleName, latest }, branch) => { return requestWithAuth('GET /search/issues', { - q: `${moduleName} type:pr ${moduleName}@${latest} in:title repo:atom/atom head:${branch} state:open` + q: `${moduleName} type:pr ${moduleName}@${latest} in:title repo:${REPO_OWNER}/${MAIN_REPO} head:${branch} state:open` }); }, addLabel: async pullRequestNumber => {