diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6df9ed549..f6837a682 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,7 +24,8 @@ jobs: cache: 'gradle' - name: Build, run tests and upload dev snapshot to Maven Central with Gradle - run: ./gradlew devSnapshot printDevSnapshotReleaseNote && ./gradlew devSanitizedVersion printSanitizedVersion >> $GITHUB_STEP_SUMMARY + run: | + ./gradlew devSnapshot printDevSnapshotReleaseNote devSanitizedVersion printSanitizedVersion env: STORE_ID: ${{ secrets.STORE_ID }} API_TOKEN: ${{ secrets.API_TOKEN }} @@ -36,6 +37,14 @@ jobs: GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.ref }} + - name: Read sanitized version + id: read_sanitized_version + run: echo "sanitized_version=$(cat sanitized_version.txt)" >> $GITHUB_ENV + + - name: Output sanitized version + run: | + echo "Sanitized Version: ${{ env.sanitized_version }}" >> $GITHUB_STEP_SUMMARY + - name: Upload artifacts with checks results uses: actions/upload-artifact@v3 if: failure() diff --git a/build.gradle.kts b/build.gradle.kts index 3998faa9e..b6f54ba80 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -281,7 +281,9 @@ fun printDevSnapshotReleaseNote(groupId: String, artifactId: String, sanitizedVe } fun printSanitizedVersion(sanitizedVersion: String): String { - return "Sanitized version: $sanitizedVersion" + val output = "Sanitized version: $sanitizedVersion" + File("sanitized_version.txt").writeText(output) + return output } class SettingsProvider {