Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add new outputs for git head and tags #135

Merged
merged 2 commits into from Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -236,7 +236,11 @@ steps:
| new_release_patch_version | Patch version of the new release. (e.g. `"0"`) |
| new_release_channel | The distribution channel on which the last release was initially made available (undefined for the default distribution channel). |
| new_release_notes | The release notes for the new release. |
| last_release_version | Version of the previous release, if there was one. (e.g. `"1.2.0"`) |
| new_release_git_head | The sha of the last commit being part of the new release |
| new_release_git_tag | The Git tag associated with the new release. |
| last_release_version | Version of the previous release, if there was one. (e.g. `1.2.0`) |
| last_release_git_head | The sha of the last commit being part of the last release, if there was one. |
| last_release_git_tag | The Git tag associated with the last release, if there was one. | |

#### Using Output Variables:
```yaml
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Expand Up @@ -41,8 +41,16 @@ outputs:
description: 'The distribution channel on which the last release was initially made available (undefined for the default distribution channel).'
new_release_notes:
description: 'The release notes for the new release.'
new_release_git_head:
description: 'The sha of the last commit being part of the new release.'
new_release_git_tag:
description: 'The Git tag associated with the new release.'
last_release_version:
description: 'Version of the previous release, if there was one.'
last_release_git_head:
description: 'The sha of the last commit being part of the last release, if there was one.'
last_release_git_tag:
description: 'The Git tag associated with the last release, if there was one.'
runs:
using: 'node16'
main: 'index.js'
8 changes: 6 additions & 2 deletions src/outputs.json
Expand Up @@ -5,6 +5,10 @@
"new_release_minor_version": "new_release_minor_version",
"new_release_patch_version": "new_release_patch_version",
"new_release_channel": "new_release_channel",
"new_release_notes": "new_release_notes",
"last_release_version": "last_release_version"
"new_release_notes": "new_release_notes",
"new_release_git_head": "new_release_git_head",
"new_release_git_tag": "new_release_git_tag",
"last_release_version": "last_release_version",
"last_release_git_head": "last_release_git_head",
"last_release_git_tag": "last_release_git_tag"
}
9 changes: 7 additions & 2 deletions src/windUpJob.task.js
Expand Up @@ -30,7 +30,7 @@ module.exports = async (result) => {
core.debug(`The release was published with plugin "${release.pluginName}".`);
}

const {version, channel, notes} = nextRelease;
const {version, channel, notes, gitHead, gitTag} = nextRelease;
const [major, minor, patch] = version.split(/\.|-|\s/g, 3);

// set outputs
Expand All @@ -40,5 +40,10 @@ module.exports = async (result) => {
core.setOutput(outputs.new_release_minor_version, minor);
core.setOutput(outputs.new_release_patch_version, patch);
core.setOutput(outputs.new_release_channel, channel);
core.setOutput(outputs.new_release_notes, notes);
core.setOutput(outputs.new_release_notes, notes);
core.setOutput(outputs.new_release_git_head, gitHead);
core.setOutput(outputs.new_release_git_tag, gitTag);
core.setOutput(outputs.last_release_version, lastRelease.version);
core.setOutput(outputs.last_release_git_head, lastRelease.gitHead);
core.setOutput(outputs.last_release_git_tag, lastRelease.gitTag);
};