mirror of
https://github.com/go-gitea/gitea
synced 2024-12-30 18:15:59 +01:00
Revert wrong change
This commit is contained in:
parent
d31fe7c60f
commit
999338848d
@ -83,9 +83,9 @@ func runSetActionsRunnerToken(c *cli.Context) error {
|
||||
setting.MustInstalled()
|
||||
|
||||
scope := c.String("scope")
|
||||
putToken := c.String("token")
|
||||
token := c.String("token")
|
||||
|
||||
respText, extra := private.SetActionsRunnerToken(ctx, scope, putToken)
|
||||
respText, extra := private.SetActionsRunnerToken(ctx, scope, token)
|
||||
if extra.HasError() {
|
||||
return handleCliResponseExtra(extra)
|
||||
}
|
||||
|
@ -10,8 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type GenerateTokenRequest struct {
|
||||
Scope string
|
||||
PutToken string
|
||||
Scope string
|
||||
}
|
||||
|
||||
// GenerateActionsRunnerToken calls the internal GenerateActionsRunnerToken function
|
||||
|
@ -41,12 +41,9 @@ func GenerateActionsRunnerToken(ctx *context.PrivateContext) {
|
||||
})
|
||||
}
|
||||
|
||||
var token *actions_model.ActionRunnerToken
|
||||
if genRequest.PutToken == "" {
|
||||
token, err = actions_model.GetLatestRunnerToken(ctx, owner, repo)
|
||||
}
|
||||
if genRequest.PutToken != "" || errors.Is(err, util.ErrNotExist) || (token != nil && !token.IsActive) {
|
||||
token, err = actions_model.NewRunnerToken(ctx, owner, repo, genRequest.PutToken)
|
||||
token, err := actions_model.GetLatestRunnerToken(ctx, owner, repo)
|
||||
if errors.Is(err, util.ErrNotExist) || (token != nil && !token.IsActive) {
|
||||
token, err = actions_model.NewRunnerToken(ctx, owner, repo, "")
|
||||
if err != nil {
|
||||
errMsg := fmt.Sprintf("error while creating runner token: %v", err)
|
||||
log.Error("NewRunnerToken failed: %v", errMsg)
|
||||
|
Loading…
Reference in New Issue
Block a user