Skip to content

Commit

Permalink
fix: Do not raise an exception when environment variables are not set…
Browse files Browse the repository at this point in the history
… for repository credentials
  • Loading branch information
oSumAtrIX committed Aug 6, 2024
1 parent 7e92b59 commit ea6bfe0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/app/revanced/patches/gradle/SettingsPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
Expand Down

0 comments on commit ea6bfe0

Please sign in to comment.