Skip to content

Commit 45c4ced

Browse files
committed
Rewrite remote to use GITHUB_TOKEN
1 parent fcb93a1 commit 45c4ced

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ scmVersion {
1818
}
1919
if (System.getenv("GITHUB_ACTIONS") == "true") {
2020
with(repository) {
21-
customPassword = System.getenv("GITHUB_TOKEN");
21+
val githubToken = System.getenv("GITHUB_TOKEN")
22+
remote = "https://$githubToken@github.com/gavlyukovskiy/spring-boot-data-source-decorator.git"
2223
}
2324
}
2425
}
@@ -182,7 +183,11 @@ tasks {
182183
if (!project.hasProperty("release.version")) {
183184
errors.add("'-Prelease.version' must be set")
184185
}
185-
if (System.getenv("GITHUB_ACTIONS") != "true") {
186+
if (System.getenv("GITHUB_ACTIONS") == "true") {
187+
if (System.getenv("GITHUB_TOKEN") == null) {
188+
errors.add("'GITHUB_TOKEN' must be passed intp Github Actions workflow")
189+
}
190+
} else {
186191
if (!project.hasProperty("release.customUsername")) {
187192
errors.add("'-Prelease.customUsername' must be set")
188193
}

0 commit comments

Comments
 (0)