mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-28 21:38:18 +00:00
Include additional metadata outputs
This commit is contained in:
parent
0c47e4e106
commit
2ee0b297bd
3 changed files with 16 additions and 5 deletions
|
|
@ -13,6 +13,8 @@ export class VersionResult {
|
||||||
* @param changed - True if the version was changed, otherwise false
|
* @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 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(
|
constructor(
|
||||||
public major: number,
|
public major: number,
|
||||||
|
|
@ -23,5 +25,7 @@ export class VersionResult {
|
||||||
public versionTag: string,
|
public versionTag: string,
|
||||||
public changed: boolean,
|
public changed: boolean,
|
||||||
public authors: string,
|
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),
|
tagFormmater.Format(versionInfo),
|
||||||
versionInfo.changed,
|
versionInfo.changed,
|
||||||
userFormatter.Format('author', []),
|
userFormatter.Format('author', []),
|
||||||
''
|
'',
|
||||||
|
'',
|
||||||
|
'0.0.0'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,6 +64,8 @@ export async function runAction(configurationProvider: ConfigurationProvider): P
|
||||||
tagFormmater.Format(versionInfo),
|
tagFormmater.Format(versionInfo),
|
||||||
versionInfo.changed,
|
versionInfo.changed,
|
||||||
userFormatter.Format('author', authors),
|
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';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
function setOutput(versionResult: VersionResult) {
|
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;
|
const repository = process.env.GITHUB_REPOSITORY;
|
||||||
|
|
||||||
|
|
@ -26,6 +26,9 @@ function setOutput(versionResult: VersionResult) {
|
||||||
core.setOutput("changed", changed.toString());
|
core.setOutput("changed", changed.toString());
|
||||||
core.setOutput("version_tag", versionTag);
|
core.setOutput("version_tag", versionTag);
|
||||||
core.setOutput("authors", authors);
|
core.setOutput("authors", authors);
|
||||||
|
core.setOutput("lastVersion", authors);
|
||||||
|
core.setOutput("previous_commit", previousCommit);
|
||||||
|
core.setOutput("previous_version", previousVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue