Skip to content

Commit 601cf12

Browse files
authored
Add step output "version" parameter for other parts of the workflow (#24)
* Add output.version * Handle case where event has no commits (pull_request close)
1 parent 31d69bd commit 601cf12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

merge-release-run.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const run = async () => {
4040
}
4141
}
4242
if (!latest) {
43-
messages = event.commits.map(commit => commit.message + '\n' + commit.body)
43+
messages = (event.commits || []).map(commit => commit.message + '\n' + commit.body)
4444
}
4545

4646
let version = 'patch'
@@ -60,6 +60,8 @@ const run = async () => {
6060
exec(`npm publish`)
6161
exec(`git checkout package.json`) // cleanup
6262
exec(`git tag ${newVersion}`)
63+
exec(`echo "::set-output name=version::${newVersion}"`) // set action event.{STEP_ID}.output.version
64+
6365
/*
6466
const env = process.env
6567
const remote = `https://${env.GITHUB_ACTOR}:${env.GITHUB_TOKEN}@github.com/${env.GITHUB_REPOSITORY}.git`

0 commit comments

Comments
 (0)