mirror of https://github.com/go-gitea/gitea.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
634 B
25 lines
634 B
// 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) (*ResponseText, ResponseExtra) { |
|
reqURL := setting.LocalURL + "api/internal/actions/generate_actions_runner_token" |
|
|
|
req := newInternalRequestAPI(ctx, reqURL, "POST", GenerateTokenRequest{ |
|
Scope: scope, |
|
}) |
|
|
|
return requestJSONResp(req, &ResponseText{}) |
|
}
|
|
|