From c0185a06214b253893463e885798dd372b163ab0 Mon Sep 17 00:00:00 2001 From: Mariusz Kogut Date: Fri, 14 May 2021 14:29:19 +0200 Subject: [PATCH] Use commitish from action inputs. Fixes #824. --- dist/index.js | 8 +++++++- index.js | 3 +++ lib/releases.js | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index ccb1a0a93..9b2930a1c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -145,6 +145,7 @@ module.exports = (app, { getRouter }) => { tag, name, disableReleaser, + commitish, } = getInput() const config = await getConfig({ @@ -195,6 +196,7 @@ module.exports = (app, { getRouter }) => { name, isPreRelease, shouldDraft, + commitish, }) let createOrUpdateReleaseResponse @@ -234,6 +236,7 @@ function getInput({ config } = {}) { core.getInput('disable-releaser').toLowerCase() === 'true', disableAutolabeler: core.getInput('disable-autolabeler').toLowerCase() === 'true', + commitish: core.getInput('commitish') || undefined, } } @@ -814,6 +817,7 @@ module.exports.generateReleaseInfo = ({ name = undefined, isPreRelease, shouldDraft, + commitish = undefined }) => { let body = config.template @@ -853,7 +857,9 @@ module.exports.generateReleaseInfo = ({ : '' } - let commitish = config['commitish'] || '' + if (commitish === undefined) { + commitish = config['commitish'] || '' + } return { name, diff --git a/index.js b/index.js index 75813873e..02fee47b5 100644 --- a/index.js +++ b/index.js @@ -131,6 +131,7 @@ module.exports = (app, { getRouter }) => { tag, name, disableReleaser, + commitish, } = getInput() const config = await getConfig({ @@ -181,6 +182,7 @@ module.exports = (app, { getRouter }) => { name, isPreRelease, shouldDraft, + commitish, }) let createOrUpdateReleaseResponse @@ -220,6 +222,7 @@ function getInput({ config } = {}) { core.getInput('disable-releaser').toLowerCase() === 'true', disableAutolabeler: core.getInput('disable-autolabeler').toLowerCase() === 'true', + commitish: core.getInput('commitish') || undefined, } } diff --git a/lib/releases.js b/lib/releases.js index fe4c73c0b..c351701fe 100644 --- a/lib/releases.js +++ b/lib/releases.js @@ -251,6 +251,7 @@ module.exports.generateReleaseInfo = ({ name = undefined, isPreRelease, shouldDraft, + commitish = undefined, }) => { let body = config.template @@ -290,7 +291,9 @@ module.exports.generateReleaseInfo = ({ : '' } - let commitish = config['commitish'] || '' + if (commitish === undefined) { + commitish = config['commitish'] || '' + } return { name,