Skip to content

Commit

Permalink
Merge pull request #1 from MariuszKogut/Fix824
Browse files Browse the repository at this point in the history
Use commitish from action inputs. Fixes release-drafter#824.
  • Loading branch information
wordrak committed Jul 21, 2021
2 parents 349214e + c0185a0 commit 8f4a03e
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 @@ -145,6 +145,7 @@ module.exports = (app, { getRouter }) => {
tag,
name,
disableReleaser,
commitish,
} = getInput()

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

let createOrUpdateReleaseResponse
Expand Down Expand Up @@ -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,
}
}

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

Expand Down Expand Up @@ -853,7 +857,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 @@ -131,6 +131,7 @@ module.exports = (app, { getRouter }) => {
tag,
name,
disableReleaser,
commitish,
} = getInput()

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

let createOrUpdateReleaseResponse
Expand Down Expand Up @@ -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,
}
}

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

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

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

return {
name,
Expand Down

0 comments on commit 8f4a03e

Please sign in to comment.