feat: Add include-compare input

This commit is contained in:
Ardalan Amini committed 2022-04-29 10:38:47 +04:30
1 parent cb7953b17f
commit 49a93eccf5
8 files changed
+36 -5

No files matched your search

+1
View File
@@ -47,5 +47,6 @@ export interface ActionInputsI {
commitTypes: TypesI;
defaultCommitType: string;
releaseName: string;
includeCompare: boolean;
semver: boolean;
}
+9 -1
View File
@@ -11,6 +11,7 @@ export async function getInputs(): Promise<ActionInputsI> {
const commitTypes = YAML.parse(getInput("commit-types", { required: true }));
const defaultCommitType = getInput("default-commit-type", { required: true });
const releaseName = getInput("release-name", { required: true });
const includeCompare = getBooleanInput("include-compare", { required: true });
const semver = getBooleanInput("semver", { required: true });
return Joi.object<ActionInputsI, true>()
@@ -20,7 +21,14 @@ export async function getInputs(): Promise<ActionInputsI> {
.required(),
defaultCommitType: Joi.string().required(),
releaseName: Joi.string().required(),
includeCompare: Joi.boolean().required(),
semver: Joi.boolean().required(),
})
.validateAsync({ commitTypes, defaultCommitType, releaseName, semver });
.validateAsync({
commitTypes,
defaultCommitType,
releaseName,
includeCompare,
semver,
});
}
+1 -1
View File
@@ -48,7 +48,7 @@ async function run() {
inputs,
});
if (tagName != null) {
if (inputs.includeCompare && tagName != null) {
changelog += `\n\n**Full Changelog**: https://github.com/${owner}/${repo}/compare/${tagName}...${inputs.releaseName}`;
}