From afbe82ba990ac7da327bdc087b27ad62023100dc Mon Sep 17 00:00:00 2001 From: Simone Busoli Date: Thu, 4 Mar 2021 08:54:34 +0100 Subject: [PATCH] fix: handling of boolean input all inputs are strings even though their yaml definition suggests that they may of other types too. see https://github.com/actions/toolkit/issues/361 --- package.json | 2 +- src/util.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d184f3ed..e4cd9e21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-action-merge-dependabot", - "version": "1.2.0", + "version": "1.2.1", "description": "", "main": "src/index.js", "scripts": { diff --git a/src/util.js b/src/util.js index f694961d..b8e57fc5 100644 --- a/src/util.js +++ b/src/util.js @@ -5,14 +5,16 @@ const { logWarning } = require('./log') const mergeMethods = { merge: 'merge', squash: 'squash', - rebase: 'rebase' + rebase: 'rebase', } const getMergeMethod = () => { const input = core.getInput('merge-method') if (!input || !mergeMethods[input]) { - logWarning('merge-method input is ignored because it is malformed, defaulting to `squash`.') + logWarning( + 'merge-method input is ignored because it is malformed, defaulting to `squash`.' + ) return mergeMethods.squash } @@ -24,5 +26,5 @@ exports.getInputs = () => ({ MERGE_METHOD: getMergeMethod(), EXCLUDE_PKGS: core.getInput('exclude') || [], MERGE_COMMENT: core.getInput('merge-comment') || '', - APPROVE_ONLY: core.getInput('approve-only') + APPROVE_ONLY: /true/i.test(core.getInput('approve-only')), })