Skip to content

Commit 385af4f

Browse files
committed
feat: added gitHead and gitTag outputs
1 parent 17e74ff commit 385af4f

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ steps:
236236
| new_release_patch_version | Patch version of the new release. (e.g. `"0"`) |
237237
| new_release_channel | The distribution channel on which the last release was initially made available (undefined for the default distribution channel). |
238238
| new_release_notes | The release notes for the new release. |
239-
| last_release_version | Version of the previous release, if there was one. (e.g. `"1.2.0"`) |
239+
| new_release_git_head | The sha of the last commit being part of the new release |
240+
| new_release_git_tag | The Git tag associated with the new release. |
241+
| last_release_version | Version of the previous release, if there was one. (e.g. `1.2.0`) |
242+
| last_release_git_head | The sha of the last commit being part of the last release, if there was one. |
243+
| last_release_git_tag | The Git tag associated with the last release, if there was one. | |
240244

241245
#### Using Output Variables:
242246
```yaml

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,16 @@ outputs:
4141
description: 'The distribution channel on which the last release was initially made available (undefined for the default distribution channel).'
4242
new_release_notes:
4343
description: 'The release notes for the new release.'
44+
new_release_git_head:
45+
description: 'The sha of the last commit being part of the new release.'
46+
new_release_git_tag:
47+
description: 'The Git tag associated with the new release.'
4448
last_release_version:
4549
description: 'Version of the previous release, if there was one.'
50+
last_release_git_head:
51+
description: 'The sha of the last commit being part of the last release, if there was one.'
52+
last_release_git_tag:
53+
description: 'The Git tag associated with the last release, if there was one.'
4654
runs:
4755
using: 'node16'
4856
main: 'index.js'

src/outputs.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"new_release_minor_version": "new_release_minor_version",
66
"new_release_patch_version": "new_release_patch_version",
77
"new_release_channel": "new_release_channel",
8-
"new_release_notes": "new_release_notes",
9-
"last_release_version": "last_release_version"
8+
"new_release_notes": "new_release_notes",
9+
"new_release_git_head": "new_release_git_head",
10+
"new_release_git_tag": "new_release_git_tag",
11+
"last_release_version": "last_release_version",
12+
"last_release_git_head": "last_release_git_head",
13+
"last_release_git_tag": "last_release_git_tag"
1014
}

src/windUpJob.task.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = async (result) => {
3030
core.debug(`The release was published with plugin "${release.pluginName}".`);
3131
}
3232

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

3636
// set outputs
@@ -40,5 +40,10 @@ module.exports = async (result) => {
4040
core.setOutput(outputs.new_release_minor_version, minor);
4141
core.setOutput(outputs.new_release_patch_version, patch);
4242
core.setOutput(outputs.new_release_channel, channel);
43-
core.setOutput(outputs.new_release_notes, notes);
43+
core.setOutput(outputs.new_release_notes, notes);
44+
core.setOutput(outputs.new_release_git_head, gitHead);
45+
core.setOutput(outputs.new_release_git_tag, gitTag);
46+
core.setOutput(outputs.last_release_version, lastRelease.version);
47+
core.setOutput(outputs.last_release_git_head, lastRelease.gitHead);
48+
core.setOutput(outputs.last_release_git_tag, lastRelease.gitTag);
4449
};

0 commit comments

Comments
 (0)