add config values for token retrieval
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s

This commit is contained in:
2026-10-11 23:04:39 +02:00
parent 58b26304ae
commit f5e9cbc423
3 changed files with 41 additions and 4 deletions
+6 -4
View File
@@ -118,16 +118,18 @@ func GetToken(client *resty.Client, server config.Server) (token string) {
_, err := client.R().
SetBody(Login{
Email: "thomas.peetz@thpeetz.de",
Password: "admin",
Email: server.Username,
Password: server.Password,
}).
SetHeader("Accept", "application/json").
SetResult(&login).
Post("http://127.0.0.1:8550/api/login")
Post(fmt.Sprintf("%s/api/login", server.Url))
if err != nil {
slog.Info("Health", "error", err.Error())
}
slog.Info("health", "token", login.Token)
if config.Verbose > 2 {
slog.Info("login", "token", login.Token)
}
return login.Token
}