forgejo/modules/private/actions.go
wxiaoguang ec2a01d1e2
Fix regression: access log template, gitea manager cli command (#24838)
Close #24836

![image](95b025d2-f25f-4246-a08a-fe44ecb787a9)

![image](c3afe1fa-2a23-420d-a016-3b67dcd04cd5)
2023-05-22 09:38:38 +08:00

26 lines
657 B
Go

// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package private
import (
"context"
"code.gitea.io/gitea/modules/setting"
)
type GenerateTokenRequest struct {
Scope string
}
// GenerateActionsRunnerToken calls the internal GenerateActionsRunnerToken function
func GenerateActionsRunnerToken(ctx context.Context, scope string) (string, ResponseExtra) {
reqURL := setting.LocalURL + "api/internal/actions/generate_actions_runner_token"
req := newInternalRequest(ctx, reqURL, "POST", GenerateTokenRequest{
Scope: scope,
})
resp, extra := requestJSONResp(req, &responseText{})
return resp.Text, extra
}