Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export async function createReleaseFromInputs(client: Client, command: CreateRel
const repository = new ReleaseRepository(client, command.spaceName);
const response = await repository.create(command);

client.info(`🎉 Release ${response.ReleaseVersion} created successfully!`);
if (command.IgnoreIfAlreadyExists) {
client.info(`🎉 Release ${response.ReleaseVersion} is ready for deployment!`);
} else {
client.info(`🎉 Release ${response.ReleaseVersion} created successfully!`);
}

task.setOutputVariable("release_number", response.ReleaseVersion);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe("getInputCommand", () => {
task.addVariableString("DefaultPackageVersion", "1.0.1");
task.addVariableString("Packages", "Step1:Foo:1.0.0\nBar:2.0.0");
task.addVariableString("GitRef", "main");
task.addVariableBoolean("IgnoreIfAlreadyExists", true);

const command = createCommandFromInputs(logger, task);
expect(command.spaceName).toBe("Default");
Expand All @@ -30,6 +31,7 @@ describe("getInputCommand", () => {
expect(command.PackageVersion).toBe("1.0.1");
expect(command.Packages).toStrictEqual(["Step1:Foo:1.0.0", "Bar:2.0.0"]);
expect(command.GitRef).toBe("main");
expect(command.IgnoreIfAlreadyExists).toBe(true);

expect(task.lastResult).toBeUndefined();
expect(task.lastResultMessage).toBeUndefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function createCommandFromInputs(logger: Logger, task: TaskWrapper): Crea
ReleaseNotes: task.getInput("ReleaseNotes"),
GitRef: task.getInput("GitRef"),
GitCommit: task.getInput("GitCommit"),
IgnoreIfAlreadyExists: task.getBoolean("IgnoreIfAlreadyExists") || undefined,
};

const releaseNotesFilePath = task.getInput("ReleaseNotesFile");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@
"helpMarkDown": "Git commit to use when creating the release for version controlled Projects. Use in conjunction with the gitRef parameter to select any previous commit.",
"groupName": "versionControl"
},
{
"name": "IgnoreIfAlreadyExists",
"type": "boolean",
"label": "Ignore Existing Release",
"defaultValue": "",
"required": false,
"helpMarkDown": "If enabled will not attempt to create a new release if there is already one with the same version number",
"groupName": "additional"
},
{
"name": "AdditionalArguments",
"type": "string",
Expand Down
Loading