Skip to content

Commit 8e6411b

Browse files
Try to get rid of txt file
1 parent a26676c commit 8e6411b

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Build, run tests and upload dev snapshot to Maven Central with Gradle
2727
run: |
28-
./gradlew devSnapshot printDevSnapshotReleaseNote && ./gradlew devSanitizedVersion printSanitizedVersion
28+
./gradlew devSnapshot printDevSnapshotReleaseNote && ./gradlew printSanitizedVersion >> $GITHUB_STEP_SUMMARY
2929
env:
3030
STORE_ID: ${{ secrets.STORE_ID }}
3131
API_TOKEN: ${{ secrets.API_TOKEN }}
@@ -37,14 +37,6 @@ jobs:
3737
GITHUB_HEAD_REF: ${{ github.head_ref }}
3838
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
3939

40-
- name: Read sanitized version
41-
id: read_sanitized_version
42-
run: echo "sanitized_version=$(cat sanitized_version.txt)" >> $GITHUB_ENV
43-
44-
- name: Output sanitized version
45-
run: |
46-
echo "Sanitized Version: ${{ env.sanitized_version }}" >> $GITHUB_STEP_SUMMARY
47-
4840
- name: Upload artifacts with checks results
4941
uses: actions/upload-artifact@v3
5042
if: failure()

build.gradle.kts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,12 @@ tasks.register(Tasks.PRINT_DEV_SNAPSHOT_RELEASE_NOTE_TASK_NAME) {
127127
dependsOn(tasks.getByName("devSnapshot"))
128128
}
129129

130-
tasks.register("devSanitizedVersion") {
131-
doLast {
132-
println("Executing devSanitizedVersion task")
133-
}
134-
}
130+
135131

136132
tasks.register(Tasks.PRINT_SUMMARY_SANITIZED_TASK_NAME) {
137133
doLast {
138134
printSanitizedVersion(project.sanitizeVersion())
139135
}
140-
dependsOn(tasks.getByName("devSanitizedVersion"))
141136
}
142137

143138
detekt {
@@ -287,9 +282,14 @@ fun printDevSnapshotReleaseNote(groupId: String, artifactId: String, sanitizedVe
287282
}
288283

289284
fun printSanitizedVersion(sanitizedVersion: String): String {
290-
val output = "Sanitized version: $sanitizedVersion"
291-
File("sanitized_version.txt").writeText(output)
292-
return output
285+
val markdownMessage = """
286+
|## Sanitized Version
287+
|
288+
|**Version:** $sanitizedVersion
289+
|
290+
""".trimMargin()
291+
println(markdownMessage)
292+
return markdownMessage
293293
}
294294

295295
class SettingsProvider {
@@ -362,7 +362,7 @@ object PublicationSettings {
362362
object Consts {
363363
const val SLOW_TESTS_LOGGING_THRESHOLD_MS = 30_000L
364364
const val MAX_TEST_RETRIES_COUNT = 3
365-
const val MAX_SHA_LENGTH = 10
365+
const val MAX_SHA_LENGTH = 8
366366
}
367367

368368
object Tasks {

0 commit comments

Comments
 (0)