ci: log hashed accessToken hashed

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2024-05-07 20:00:13 +02:00
parent 3d6bd1ef75
commit fd866855eb
Signed by: moonleay
GPG key ID: 82667543CCD715FB

View file

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import org.gradle.internal.impldep.org.apache.commons.codec.digest.DigestUtils
import org.jetbrains.gradle.ext.ProjectSettings
import org.jetbrains.gradle.ext.TaskTriggersConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@ -190,12 +191,13 @@ publishing {
val repoOwner = System.getenv("GITHUB_REPOSITORY_OWNER")
val serverUrl = System.getenv("GITHUB_SERVER_URL")
val accessToken = System.getenv("GITHUB_TOKEN")
println("acT hashed: ${DigestUtils.sha256Hex(accessToken)}")
url = uri("$serverUrl/api/packages/$repoOwner/maven")
authentication {
create("header", HttpHeaderAuthentication::class.java) {
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "Bearer $accessToken"
value = "token $accessToken"
}
}
}