Skip to content

Commit

Permalink
Merge pull request #445 from gradle/dd/no-duplicate-build-results
Browse files Browse the repository at this point in the history
Avoid appending to existing build-results file
  • Loading branch information
bigdaz authored Sep 29, 2022
2 parents 8545e5a + 394498f commit fd32ae9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
def buildResultsDir = new File(runnerTempDir, ".build-results")
buildResultsDir.mkdirs()
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
if (!buildResultsFile.exists()) {
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
}
}
}

0 comments on commit fd32ae9

Please sign in to comment.