Skip to content

Commit

Permalink
Merge pull request #538 from alonsohki/name-and-tag-name-outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jetersen committed May 28, 2020
2 parents fdadde1 + 30e6f1e commit 4c46a77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ The Release Drafter GitHub Action sets a couple of outputs which can be used as
| Output | Description |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | The ID of the release that was created or updated. |
| `name` | The name of this release. |
| `tag_name` | The name of the tag associated with this release. |
| `html_url` | The URL users can navigate to in order to view the release. i.e. `https://github.com/octocat/Hello-World/releases/v1.0.0`. |
| `upload_url` | The URL for uploading assets to the release, which could be used by GitHub Actions for additional uses, for example the [`@actions/upload-release-asset GitHub Action`](https://www.github.com/actions/upload-release-asset). |

Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ module.exports = (app) => {

function setActionOutput(releaseResponse) {
const {
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl },
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl, tag_name: tagName, name: name },
} = releaseResponse
if (releaseId && Number.isInteger(releaseId))
core.setOutput('id', releaseId.toString())
if (htmlUrl) core.setOutput('html_url', htmlUrl)
if (uploadUrl) core.setOutput('upload_url', uploadUrl)
if (tagName) core.setOutput('tag_name', tagName)
if (name) core.setOutput('name', name)
}

0 comments on commit 4c46a77

Please sign in to comment.