Skip to content

Commit

Permalink
feat: add type, channel, gitHead, gitTag, name outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
codfish committed Apr 2, 2023
1 parent dcd1875 commit 04df07b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
14 changes: 12 additions & 2 deletions README.md
Expand Up @@ -286,7 +286,7 @@ might be so this is a way to cover more cases.

**Docs:** https://help.github.com/en/articles/metadata-syntax-for-github-actions#outputs

**Output Variables**:
#### Output Variables

| Output Variable | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -296,8 +296,13 @@ might be so this is a way to cover more cases.
| release-minor | The new releases' minor version number, i.e. `8` |
| release-patch | The new releases' patch version number, i.e. `3` |
| release-notes | The release notes of the next release. |
| type | The semver export type of the release, e.g. `major`, `prerelease`, etc. |
| channel | The release channel of the release. |
| git-head | The git hash of the release. |
| git-tag | The version with v prefix. |
| name | The release name. |

**Environment Variables**:
#### Environment Variables

| Environment Variable | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -307,6 +312,11 @@ might be so this is a way to cover more cases.
| RELEASE_MINOR | The new releases' minor version number, i.e. `8` |
| RELEASE_PATCH | The new releases' patch version number, i.e. `3` |
| RELEASE_NOTES | The release notes of the next release in markdown. |
| RELEASE_TYPE | The semver export type of the release, e.g. `major`, `prerelease`, etc. |
| RELEASE_CHANNEL | The release channel of the release. |
| RELEASE_GIT_HEAD | The git hash of the release. |
| RELEASE_GIT_TAG | The version with v prefix. |
| RELEASE_NAME | The release name. |

## Maintenance

Expand Down
22 changes: 17 additions & 5 deletions action.yml
Expand Up @@ -56,15 +56,27 @@ inputs:
outputs:
new-release-published:
description:
"Either `'true'` when a new release was published or `'false'` when no release was published"
"Either `'true'` when a new release was published or `'false'` when no release was published."
release-version:
description: "The new releases' semantic version, i.e. `1.8.3`"
description: "The new releases' semantic version, i.e. `1.8.3`."
release-major:
description: "The new releases' major version number, i.e. `1`"
description: "The new releases' major version number, i.e. `1`."
release-minor:
description: "The new releases' minor version number, i.e. `8`"
description: "The new releases' minor version number, i.e. `8`."
release-patch:
description: "The new releases' patch version number, i.e. `3`"
description: "The new releases' patch version number, i.e. `3`."
release-notes:
description: "The release notes of the next release."
type:
description: "The semver export type of the release, e.g. `major`, `prerelease`, etc."
channel:
description: "The release channel of the release."
git-head:
description: "The git hash of the release."
git-tag:
description: "The version with v prefix."
name:
description: "The release name."
runs:
using: 'docker'
image: 'Dockerfile'
12 changes: 11 additions & 1 deletion entrypoint.js
Expand Up @@ -112,20 +112,30 @@ async function run() {
}

// set outputs
const { version, notes } = nextRelease;
const { version, notes, type, channel, gitHead, gitTag, name } = nextRelease;
const [major, minor, patch] = version.split('.');
core.exportVariable('NEW_RELEASE_PUBLISHED', 'true');
core.exportVariable('RELEASE_VERSION', version);
core.exportVariable('RELEASE_MAJOR', major);
core.exportVariable('RELEASE_MINOR', minor);
core.exportVariable('RELEASE_PATCH', patch);
core.exportVariable('RELEASE_NOTES', notes);
core.exportVariable('RELEASE_TYPE', type);
core.exportVariable('RELEASE_CHANNEL', channel);
core.exportVariable('RELEASE_GIT_HEAD', gitHead);
core.exportVariable('RELEASE_GIT_TAG', gitTag);
core.exportVariable('RELEASE_NAME', name);
core.setOutput('new-release-published', 'true');
core.setOutput('release-version', version);
core.setOutput('release-major', major);
core.setOutput('release-minor', minor);
core.setOutput('release-patch', patch);
core.setOutput('release-notes', notes);
core.setOutput('type', type);
core.setOutput('channel', channel);
core.setOutput('git-head', gitHead);
core.setOutput('git-tag', gitTag);
core.setOutput('name', name);
}

run().catch(core.setFailed);

0 comments on commit 04df07b

Please sign in to comment.