From 7ac817ba76c1c31557c1529b293a85b416f3826f Mon Sep 17 00:00:00 2001 From: Joseph Petersen Date: Sun, 6 Feb 2022 02:24:05 +0100 Subject: [PATCH] Bump @probot/octokit-plugin-config from 1.1.4 to 1.1.5 (#1057) --- dist/index.js | 23 ++++++++++++----------- yarn.lock | 6 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 196f50228..4ab765973 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8010,7 +8010,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var yaml = _interopDefault(__nccwpck_require__(21917)); -const VERSION = "1.1.4"; +const VERSION = "1.1.5"; function _defineProperty(obj, key, value) { if (key in obj) { @@ -8215,12 +8215,13 @@ async function getConfigFiles(octokit, { repo, path, ref: branch - }); // if no configuration file present in selected repository, + }); + const files = [requestedRepoFile]; // if no configuration file present in selected repository, // try to load it from the `.github` repository if (!requestedRepoFile.config) { if (repo === ".github") { - return [requestedRepoFile]; + return files; } const defaultRepoConfig = await getConfigFile(octokit, { @@ -8228,12 +8229,13 @@ async function getConfigFiles(octokit, { repo: ".github", path }); - return [requestedRepoFile, defaultRepoConfig]; - } // if the configuration has no `_extends` key, we are done here. + files.push(defaultRepoConfig); + } + const file = files[files.length - 1]; // if the configuration has no `_extends` key, we are done here. - if (!requestedRepoFile.config._extends) { - return [requestedRepoFile]; + if (!file.config || !file.config._extends) { + return files; } // parse the value of `_extends` into request parameters to // retrieve the new configuration file @@ -8241,12 +8243,11 @@ async function getConfigFiles(octokit, { let extendConfigOptions = extendsToGetContentParams({ owner, path, - url: requestedRepoFile.url, - extendsValue: requestedRepoFile.config._extends + url: file.url, + extendsValue: file.config._extends }); // remove the `_extends` key from the configuration that is returned - delete requestedRepoFile.config._extends; - const files = [requestedRepoFile]; // now load the configuration linked from the `_extends` key. If that + delete file.config._extends; // now load the configuration linked from the `_extends` key. If that // configuration also includes an `_extends` key, then load that configuration // as well, until the target configuration has no `_extends` key diff --git a/yarn.lock b/yarn.lock index b95526c17..099eb65fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -762,9 +762,9 @@ is-base64 "^1.1.0" "@probot/octokit-plugin-config@^1.0.0": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@probot/octokit-plugin-config/-/octokit-plugin-config-1.1.4.tgz#31516fbc77732c781d64b084c0a0e98fc6ee3ce3" - integrity sha512-/wPms7XaP7vohb7iLw0FKGCju5wXdaeEU2jfb0ysLv2u5u5Ex5cJhRooS/1pMkPhkQPNRwo1NFrodT/vha/ZQw== + version "1.1.5" + resolved "https://registry.yarnpkg.com/@probot/octokit-plugin-config/-/octokit-plugin-config-1.1.5.tgz#169f6da21261c39443681f16c4b37c294d46a437" + integrity sha512-dPrccDkb5QVZYZ3Gq3aDEdfsuqid687iu+z3jBKFI1LwgQuRaUsmihR0ZLHdXKX6HK6rUw/5Jxg5ZUo0OWWUSA== dependencies: "@types/js-yaml" "^4.0.5" js-yaml "^4.1.0"