diff options
Diffstat (limited to '')
-rw-r--r-- | modules/private/actions.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/private/actions.go b/modules/private/actions.go new file mode 100644 index 0000000..311a283 --- /dev/null +++ b/modules/private/actions.go @@ -0,0 +1,25 @@ +// 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{}) +} |