mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-15 18:08:23 -07:00
26 lines
631 B
Go
26 lines
631 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) (*ResponseText, ResponseExtra) {
|
|
reqURL := setting.LocalURL + "api/internal/actions/generate_actions_runner_token"
|
|
|
|
req := newInternalRequest(ctx, reqURL, "POST", GenerateTokenRequest{
|
|
Scope: scope,
|
|
})
|
|
|
|
return requestJSONResp(req, &ResponseText{})
|
|
}
|