Skip to content

Commit

Permalink
Merge pull request release-drafter#445 from Jetersen/fix/setOutput
Browse files Browse the repository at this point in the history
fix setOutput
  • Loading branch information
jetersen authored Mar 27, 2020
2 parents 2dbaf19 + e4db448 commit ec0f2c5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function setActionOutput(releaseResponse) {
const {
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl }
} = releaseResponse
core.setOutput('id', releaseId)
core.setOutput('html_url', htmlUrl)
core.setOutput('upload_url', uploadUrl)
if (releaseId && Number.isInteger(releaseId))
core.setOutput('id', releaseId.toString())
if (htmlUrl) core.setOutput('html_url', htmlUrl)
if (uploadUrl) core.setOutput('upload_url', uploadUrl)
}
62 changes: 31 additions & 31 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('release-drafter', () => {
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -179,7 +179,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -234,7 +234,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -288,7 +288,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -331,7 +331,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -376,7 +376,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -418,7 +418,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -470,7 +470,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -507,7 +507,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -554,7 +554,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -608,7 +608,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -660,7 +660,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -716,7 +716,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -776,7 +776,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -829,7 +829,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -871,7 +871,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -911,7 +911,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -951,7 +951,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -1001,7 +1001,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1052,7 +1052,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1103,7 +1103,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1167,7 +1167,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1218,7 +1218,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1282,7 +1282,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1345,7 +1345,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

const payload = require('./fixtures/push')

Expand Down Expand Up @@ -1442,7 +1442,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -1515,7 +1515,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -1631,7 +1631,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -1670,7 +1670,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -1707,7 +1707,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down Expand Up @@ -1742,7 +1742,7 @@ Previous tag: ''
return true
}
)
.reply(200)
.reply(200, require('./fixtures/release'))

await probot.receive({
name: 'push',
Expand Down

0 comments on commit ec0f2c5

Please sign in to comment.