From ea6bfe0c86b7b1c114bfa520753e6b53c501b0b7 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 6 Aug 2024 19:06:43 +0200 Subject: [PATCH] fix: Do not raise an exception when environment variables are not set for repository credentials --- .../kotlin/app/revanced/patches/gradle/SettingsPlugin.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/gradle/SettingsPlugin.kt b/src/main/kotlin/app/revanced/patches/gradle/SettingsPlugin.kt index 59250c9..94ff520 100644 --- a/src/main/kotlin/app/revanced/patches/gradle/SettingsPlugin.kt +++ b/src/main/kotlin/app/revanced/patches/gradle/SettingsPlugin.kt @@ -31,10 +31,8 @@ abstract class SettingsPlugin @Inject constructor( // A repository must be specified. "registry" is a dummy. repository.url = URI("https://maven.pkg.github.com/revanced/registry") repository.credentials { - it.username = providers.gradleProperty("gpr.user") - .orElse(System.getenv("GITHUB_ACTOR")).get() - it.password = providers.gradleProperty("gpr.key") - .orElse(System.getenv("GITHUB_TOKEN")).get() + it.username = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR") + it.password = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN") } } }