Skip to content

Commit

Permalink
Use commitish from action inputs. Fixes #824. (#865)
Browse files Browse the repository at this point in the history
Co-authored-by: Mariusz Kogut <mk@hanmdade-systems.de>
  • Loading branch information
danielcweber and Mariusz Kogut committed Sep 6, 2021
1 parent fbb074a commit 8c2bf28
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion dist/index.js
Expand Up @@ -146,6 +146,7 @@ module.exports = (app, { getRouter }) => {
tag,
name,
disableReleaser,
commitish,
} = getInput()

const config = await getConfig({
Expand Down Expand Up @@ -196,6 +197,7 @@ module.exports = (app, { getRouter }) => {
name,
isPreRelease,
shouldDraft,
commitish,
})

let createOrUpdateReleaseResponse
Expand Down Expand Up @@ -235,6 +237,7 @@ function getInput({ config } = {}) {
core.getInput('disable-releaser').toLowerCase() === 'true',
disableAutolabeler:
core.getInput('disable-autolabeler').toLowerCase() === 'true',
commitish: core.getInput('commitish') || undefined,
}
}

Expand Down Expand Up @@ -823,6 +826,7 @@ module.exports.generateReleaseInfo = ({
name = undefined,
isPreRelease,
shouldDraft,
commitish = undefined
}) => {
let body = config.template

Expand Down Expand Up @@ -862,7 +866,9 @@ module.exports.generateReleaseInfo = ({
: ''
}

let commitish = config['commitish'] || ''
if (commitish === undefined) {
commitish = config['commitish'] || ''
}

return {
name,
Expand Down
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -132,6 +132,7 @@ module.exports = (app, { getRouter }) => {
tag,
name,
disableReleaser,
commitish,
} = getInput()

const config = await getConfig({
Expand Down Expand Up @@ -182,6 +183,7 @@ module.exports = (app, { getRouter }) => {
name,
isPreRelease,
shouldDraft,
commitish,
})

let createOrUpdateReleaseResponse
Expand Down Expand Up @@ -221,6 +223,7 @@ function getInput({ config } = {}) {
core.getInput('disable-releaser').toLowerCase() === 'true',
disableAutolabeler:
core.getInput('disable-autolabeler').toLowerCase() === 'true',
commitish: core.getInput('commitish') || undefined,
}
}

Expand Down
5 changes: 4 additions & 1 deletion lib/releases.js
Expand Up @@ -253,6 +253,7 @@ module.exports.generateReleaseInfo = ({
name = undefined,
isPreRelease,
shouldDraft,
commitish = undefined,
}) => {
let body = config.template

Expand Down Expand Up @@ -292,7 +293,9 @@ module.exports.generateReleaseInfo = ({
: ''
}

let commitish = config['commitish'] || ''
if (commitish === undefined) {
commitish = config['commitish'] || ''
}

return {
name,
Expand Down

0 comments on commit 8c2bf28

Please sign in to comment.