From a5747367dfb71c7ea9ed46d78b3db73308b36270 Mon Sep 17 00:00:00 2001 From: Pavel910 Date: Mon, 3 Dec 2018 18:00:44 +0100 Subject: [PATCH] Fix release script params params checks and handle tagger data. --- scripts/release/plugins/github/publish.js | 12 +++++++----- scripts/release/utils/buildParams.js | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/release/plugins/github/publish.js b/scripts/release/plugins/github/publish.js index dbd460fa7c2..f45b8df7810 100644 --- a/scripts/release/plugins/github/publish.js +++ b/scripts/release/plugins/github/publish.js @@ -26,15 +26,17 @@ module.exports = (pluginConfig = {}) => { target_commitish: config.branch }; - let tagger = {}; + let tagger = null; // Get current user to construct proper tagger data. try { const user = await github.users.getAuthenticated({}); - tagger = { - name: user.data.name, - email: user.data.email - }; + if (user && user.data && user.data.email) { + tagger = { + name: user.data.name, + email: user.data.email + }; + } } catch (e) { logger.error(e.message); } diff --git a/scripts/release/utils/buildParams.js b/scripts/release/utils/buildParams.js index 5c239bca875..13e2f984b7f 100644 --- a/scripts/release/utils/buildParams.js +++ b/scripts/release/utils/buildParams.js @@ -9,8 +9,8 @@ module.exports = async config => { logger: config.logger || logger(), git, config: { - preview: config.preview || false, - ci: config.ci || true, + preview: config.hasOwnProperty("preview") ? config.preview : false, + ci: config.hasOwnProperty("ci") ? config.ci : true, branch: config.branch || "master", tagFormat: config.tagFormat || "v<%= version %>", registryUrl: config.registryUrl || "https://registry.npmjs.org",