From 90469b02b471d8f7cba6c353b4c1ec1bab5bcde4 Mon Sep 17 00:00:00 2001 From: mmarchini Date: Thu, 23 Jul 2020 11:12:52 -0700 Subject: [PATCH] feat: output tag name and upload url (#43) The tag name is useful to interact with the release on following steps, and the upload url is useful to upload assets to the release. Fix: https://github.com/GoogleCloudPlatform/release-please-action/issues/8 Fix: https://github.com/GoogleCloudPlatform/release-please-action/issues/41 --- dist/index.js | 9 +++++++-- index.js | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8b20146..0d9495c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3595,7 +3595,12 @@ async function main () { token }) const releaseCreated = await gr.createRelease() - if (releaseCreated) core.setOutput('release_created', true) + if (releaseCreated) { + const { upload_url, tag_name } = releaseCreated + core.setOutput('release_created', true) + core.setOutput('upload_url', upload_url) + core.setOutput('tag_name', tag_name) + } // Next we check for PRs merged since the last release, and groom the // release PR: @@ -5621,7 +5626,7 @@ module.exports = { /* 191 */ /***/ (function(module) { -module.exports = {"_from":"release-please@latest","_id":"release-please@5.4.0","_inBundle":false,"_integrity":"sha512-y88BacmFBciGHfnvmM7KF8m1vkglJxDB7l7muieqbXnn9IRt/XExhDpb4VaJwLMn2QeWQZfCUrQMlkZT+wRNiQ==","_location":"/release-please","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"release-please@latest","name":"release-please","escapedName":"release-please","rawSpec":"latest","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/release-please/-/release-please-5.4.0.tgz","_shasum":"45b12220256077e588ef56cd24fb356f2928c736","_spec":"release-please@latest","_where":"/Users/bencoe/oss/release-please-action","author":{"name":"Google Inc."},"bin":{"release-please":"build/src/bin/release-please.js"},"bugs":{"url":"https://github.com/googleapis/release-please/issues"},"bundleDependencies":false,"dependencies":{"@octokit/graphql":"^4.3.1","@octokit/request":"^5.3.4","@octokit/rest":"^18.0.0","chalk":"^4.0.0","concat-stream":"^2.0.0","conventional-changelog-conventionalcommits":"^4.0.0","conventional-changelog-writer":"^4.0.6","conventional-commits-filter":"^2.0.2","conventional-commits-parser":"^3.0.3","figures":"^3.0.0","parse-github-repo-url":"^1.4.1","semver":"^7.0.0","type-fest":"^0.15.0","yargs":"^15.0.0"},"deprecated":false,"description":"generate release PRs based on the conventionalcommits.org spec","devDependencies":{"@octokit/types":"^5.0.0","@types/chai":"^4.1.7","@types/mocha":"^7.0.0","@types/node":"^11.13.6","@types/semver":"^7.0.0","@types/yargs":"^15.0.4","c8":"^7.0.0","chai":"^4.2.0","cross-env":"^7.0.0","gts":"^2.0.0","mocha":"^8.0.0","nock":"^12.0.0","snap-shot-it":"^7.0.0","typescript":"^3.8.3"},"engines":{"node":">=10.12.0"},"files":["build/src","templates","!build/src/**/*.map"],"homepage":"https://github.com/googleapis/release-please#readme","keywords":["release","conventional-commits"],"license":"Apache-2.0","main":"./build/src/index.js","name":"release-please","repository":{"type":"git","url":"git+https://github.com/googleapis/release-please.git"},"scripts":{"clean":"gts clean","compile":"tsc -p .","docs-test":"echo add docs tests","fix":"gts fix","lint":"gts check","prepare":"npm run compile","presystem-test":"npm run compile","pretest":"npm run compile","system-test":"echo 'no system tests'","test":"cross-env ENVIRONMENT=test c8 mocha --recursive --timeout=5000 build/test","test:all":"cross-env ENVIRONMENT=test c8 mocha --recursive --timeout=20000 build/system-test build/test","test:snap":"SNAPSHOT_UPDATE=1 npm test"},"version":"5.4.0"}; +module.exports = {"_args":[["release-please@5.4.0","/home/mmarchini/workspace/misc/release-please-action"]],"_from":"release-please@5.4.0","_id":"release-please@5.4.0","_inBundle":false,"_integrity":"sha512-y88BacmFBciGHfnvmM7KF8m1vkglJxDB7l7muieqbXnn9IRt/XExhDpb4VaJwLMn2QeWQZfCUrQMlkZT+wRNiQ==","_location":"/release-please","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"release-please@5.4.0","name":"release-please","escapedName":"release-please","rawSpec":"5.4.0","saveSpec":null,"fetchSpec":"5.4.0"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/release-please/-/release-please-5.4.0.tgz","_spec":"5.4.0","_where":"/home/mmarchini/workspace/misc/release-please-action","author":{"name":"Google Inc."},"bin":{"release-please":"build/src/bin/release-please.js"},"bugs":{"url":"https://github.com/googleapis/release-please/issues"},"dependencies":{"@octokit/graphql":"^4.3.1","@octokit/request":"^5.3.4","@octokit/rest":"^18.0.0","chalk":"^4.0.0","concat-stream":"^2.0.0","conventional-changelog-conventionalcommits":"^4.0.0","conventional-changelog-writer":"^4.0.6","conventional-commits-filter":"^2.0.2","conventional-commits-parser":"^3.0.3","figures":"^3.0.0","parse-github-repo-url":"^1.4.1","semver":"^7.0.0","type-fest":"^0.15.0","yargs":"^15.0.0"},"description":"generate release PRs based on the conventionalcommits.org spec","devDependencies":{"@octokit/types":"^5.0.0","@types/chai":"^4.1.7","@types/mocha":"^7.0.0","@types/node":"^11.13.6","@types/semver":"^7.0.0","@types/yargs":"^15.0.4","c8":"^7.0.0","chai":"^4.2.0","cross-env":"^7.0.0","gts":"^2.0.0","mocha":"^8.0.0","nock":"^12.0.0","snap-shot-it":"^7.0.0","typescript":"^3.8.3"},"engines":{"node":">=10.12.0"},"files":["build/src","templates","!build/src/**/*.map"],"homepage":"https://github.com/googleapis/release-please#readme","keywords":["release","conventional-commits"],"license":"Apache-2.0","main":"./build/src/index.js","name":"release-please","repository":{"type":"git","url":"git+https://github.com/googleapis/release-please.git"},"scripts":{"clean":"gts clean","compile":"tsc -p .","docs-test":"echo add docs tests","fix":"gts fix","lint":"gts check","prepare":"npm run compile","presystem-test":"npm run compile","pretest":"npm run compile","system-test":"echo 'no system tests'","test":"cross-env ENVIRONMENT=test c8 mocha --recursive --timeout=5000 build/test","test:all":"cross-env ENVIRONMENT=test c8 mocha --recursive --timeout=20000 build/system-test build/test","test:snap":"SNAPSHOT_UPDATE=1 npm test"},"version":"5.4.0"}; /***/ }), /* 192 */, diff --git a/index.js b/index.js index 5ec9720..acc5dfb 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,12 @@ async function main () { token }) const releaseCreated = await gr.createRelease() - if (releaseCreated) core.setOutput('release_created', true) + if (releaseCreated) { + const { upload_url, tag_name } = releaseCreated + core.setOutput('release_created', true) + core.setOutput('upload_url', upload_url) + core.setOutput('tag_name', tag_name) + } // Next we check for PRs merged since the last release, and groom the // release PR: