Skip to content

Commit 54c0f63

Browse files
committed
Fix missing authorization for repository
1 parent a1d999a commit 54c0f63

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

build.gradle.kts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,23 @@ fun RepositoryHandler.flintRepository() {
3030
var bearerToken = System.getenv("FLINT_DISTRIBUTOR_BEARER_TOKEN")
3131

3232
if (bearerToken == null) {
33-
bearerToken = project.properties["net.flintmc.distributor.bearer-token"].toString()
33+
bearerToken = project.properties["net.flintmc.distributor.bearer-token"]?.toString()
3434
}
3535

3636
maven {
3737
setUrl(distributorUrl)
3838
name = "Flint"
39+
40+
if(bearerToken != null) {
41+
authentication {
42+
create<HttpHeaderAuthentication>("header")
43+
}
44+
45+
credentials(HttpHeaderCredentials::class) {
46+
name = "Authorization"
47+
value = "Bearer $bearerToken"
48+
}
49+
}
3950
}
4051
}
4152

0 commit comments

Comments
 (0)