ci: fixed auth header for upload

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2024-05-07 18:57:08 +02:00
parent 3f8673cadb
commit 6862174aee
Signed by: moonleay
GPG key ID: 82667543CCD715FB

View file

@ -186,15 +186,14 @@ publishing {
repositories {
if (System.getenv("CI") != null) {
maven {
name = "Forgejo"
name = "Codeberg"
val repoOwner = System.getenv("GITHUB_REPOSITORY_OWNER")
// val apiEndpoint = System.getenv("GITHUB_API_URL")
val serverUrl = System.getenv("GITHUB_SERVER_URL")
url = uri("$serverUrl/api/packages/$repoOwner/maven")
authentication {
create("header", HttpHeaderAuthentication::class.java) {
val accessToken = System.getenv("GITHUB_TOKEN")
credentials(HttpHeaderCredentials::class.java) {
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token $accessToken"
}