Skip to content

Commit

Permalink
Move matrix fill to else branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dnestoro authored and fniephaus committed Mar 21, 2024
1 parent 2fb58fe commit 7a7f266
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,28 +120,29 @@ Provider<Task> generateMatrixDiffCoordinates = tasks.register("generateMatrixDif
if (!project.hasProperty("baseCommit")) {
throw new GradleException("Missing 'baseCommit' property! Rerun Gradle with '-PbaseCommit=<commit-hash>'")
}

if (diffCoordinates.isEmpty()) {
def matrix = [
"coordinates": ["No matches found!"]
]

matrix.putAll(matrixDefault)
/**
* when we are introducing a new metadata, we should test it against all versions,
* not just the oldest and the newest one (which we are testing by default)
*/
matrix.version.add("21");
matrix.version.add("22");
matrix.version.add("dev");

println "No changed coordinates were found!"
println "::set-output name=matrix::${JsonOutput.toJson(matrix)}"
println "::set-output name=none-found::true"
} else {
def matrix = [
"coordinates": diffCoordinates
]

matrix.putAll(matrixDefault)
/**
* when we are introducing a new metadata, we should test it against all versions,
* not just the oldest and the newest one (which we are testing by default)
*/
matrix.version.add("21")
matrix.version.add("22")
matrix.version.add("dev")
println "::set-output name=matrix::${JsonOutput.toJson(matrix)}"
println "::set-output name=none-found::false"
}
Expand Down

0 comments on commit 7a7f266

Please sign in to comment.