Skip to content

Commit

Permalink
#761 | Fix released-version output reporting SNAPSHOT version (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslaw-panuszewski committed Aug 5, 2024
1 parent b014f23 commit 93e940c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.junit.contrib.java.lang.system.EnvironmentVariables
import java.nio.charset.StandardCharsets
import java.nio.file.Files

import static java.util.stream.Collectors.toList
import static pl.allegro.tech.build.axion.release.TagPrefixConf.fullPrefix

class SimpleIntegrationTest extends BaseIntegrationTest {
Expand Down Expand Up @@ -51,7 +52,8 @@ class SimpleIntegrationTest extends BaseIntegrationTest {
runGradle('release', '-Prelease.version=1.0.0', '-Prelease.localOnly', '-Prelease.disableChecks')

then:
outputFile.getText().contains('released-version=1.0.0')
def definedEnvVariables = outputFile.getText().lines().collect(toList())
definedEnvVariables.contains('released-version=1.0.0')

cleanup:
environmentVariablesRule.clear("GITHUB_ACTIONS", "GITHUB_OUTPUT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class ReleaseTask extends BaseAxionTask {
if (System.getenv().containsKey('GITHUB_ACTIONS')) {
Files.write(
Paths.get(System.getenv('GITHUB_OUTPUT')),
"released-version=${versionConfig.version}\n".getBytes(),
"released-version=${versionConfig.uncached.decoratedVersion}\n".getBytes(),
StandardOpenOption.APPEND
)
}
Expand Down

0 comments on commit 93e940c

Please sign in to comment.