mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 04:58:17 +00:00
Include additional metadata outputs
This commit is contained in:
parent
0c47e4e106
commit
2ee0b297bd
3 changed files with 16 additions and 5 deletions
|
|
@ -12,7 +12,9 @@ export class VersionResult {
|
|||
* @param versionTag - The string to be used as a Git tag
|
||||
* @param changed - True if the version was changed, otherwise false
|
||||
* @param authors - Authors formatted according to the format mode (e.g. JSON, CSV, YAML, etc.)
|
||||
* @param currentCommit - The current commit hash
|
||||
* @param currentCommit - The current commit hash
|
||||
* @param previousCommit - The previous commit hash
|
||||
* @param previousVersion - the previous version
|
||||
*/
|
||||
constructor(
|
||||
public major: number,
|
||||
|
|
@ -23,5 +25,7 @@ export class VersionResult {
|
|||
public versionTag: string,
|
||||
public changed: boolean,
|
||||
public authors: string,
|
||||
public currentCommit: string) { }
|
||||
public currentCommit: string,
|
||||
public previousCommit: string,
|
||||
public previousVersion: string) { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ export async function runAction(configurationProvider: ConfigurationProvider): P
|
|||
tagFormmater.Format(versionInfo),
|
||||
versionInfo.changed,
|
||||
userFormatter.Format('author', []),
|
||||
''
|
||||
'',
|
||||
'',
|
||||
'0.0.0'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -62,6 +64,8 @@ export async function runAction(configurationProvider: ConfigurationProvider): P
|
|||
tagFormmater.Format(versionInfo),
|
||||
versionInfo.changed,
|
||||
userFormatter.Format('author', authors),
|
||||
currentCommit
|
||||
currentCommit,
|
||||
lastRelease.hash,
|
||||
`${lastRelease.major}.${lastRelease.minor}.${lastRelease.patch}`
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { VersionResult } from './VersionResult';
|
|||
import * as core from '@actions/core';
|
||||
|
||||
function setOutput(versionResult: VersionResult) {
|
||||
const { major, minor, patch, increment, formattedVersion, versionTag, changed, authors, currentCommit } = versionResult;
|
||||
const { major, minor, patch, increment, formattedVersion, versionTag, changed, authors, currentCommit, previousCommit, previousVersion } = versionResult;
|
||||
|
||||
const repository = process.env.GITHUB_REPOSITORY;
|
||||
|
||||
|
|
@ -26,6 +26,9 @@ function setOutput(versionResult: VersionResult) {
|
|||
core.setOutput("changed", changed.toString());
|
||||
core.setOutput("version_tag", versionTag);
|
||||
core.setOutput("authors", authors);
|
||||
core.setOutput("lastVersion", authors);
|
||||
core.setOutput("previous_commit", previousCommit);
|
||||
core.setOutput("previous_version", previousVersion);
|
||||
}
|
||||
|
||||
export async function run() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue