Skip to content

Commit db40d53

Browse files
Add support for different workflow IDs in InstallSnapshotMojo (#21)
Add a new parameter 'proWorkflowId' to distinguish between workflows in liquibase/liquibase-pro and other repositories. Previously, all repositories were assumed to use the same workflow ID, but this is not always the case. This update allows the correct workflow ID to be used per repository, enhancing the flexibility and accuracy of the program.
1 parent b932968 commit db40d53

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/liquibase/sdk/maven/plugins/InstallSnapshotMojo.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public class InstallSnapshotMojo extends AbstractGitHubMojo {
3434
@Parameter(property = "liquibase.sdk.workflowId")
3535
protected String workflowId;
3636

37+
@Parameter(property = "liquibase.sdk.proWorkflowId")
38+
protected String proWorkflowId;
39+
3740
public void execute() throws MojoExecutionException, MojoFailureException {
3841

3942
for (String repo : getRepos()) {
@@ -49,16 +52,20 @@ public void execute() throws MojoExecutionException, MojoFailureException {
4952
log.info("Found matching branch: " + matchingLabel);
5053

5154
final String artifactName;
55+
final String currentWorkflowId;
5256
if (repo.endsWith("/liquibase")) {
5357
String headBranchFilename = matchingLabel.replaceFirst(".*:", "").replaceAll("[^a-zA-Z0-9\\-.]", "_");
5458
artifactName = "liquibase-artifacts-" + headBranchFilename;
59+
currentWorkflowId = workflowId;
5560
} else if (repo.equals("liquibase/liquibase-pro")) {
5661
artifactName = "liquibase-commercial-modules";
62+
currentWorkflowId = proWorkflowId;
5763
} else {
5864
artifactName = repo.replaceFirst(".*/", "") + "-artifacts";
65+
currentWorkflowId = null;
5966
}
6067

61-
File file = github.downloadArtifact(repo, matchingLabel, artifactName, GitHubClient.getWorkflowId(repo, workflowId), skipFailedBuilds);
68+
File file = github.downloadArtifact(repo, matchingLabel, artifactName, GitHubClient.getWorkflowId(repo, currentWorkflowId), skipFailedBuilds);
6269

6370
if (file == null) {
6471
throw new MojoFailureException("Cannot find " + artifactName + ".zip");

0 commit comments

Comments
 (0)