|
|
|
@ -12,6 +12,7 @@ import (
|
|
|
|
|
"strings"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
actions_model "code.gitea.io/gitea/models/actions"
|
|
|
|
|
activities_model "code.gitea.io/gitea/models/activities"
|
|
|
|
|
"code.gitea.io/gitea/models/db"
|
|
|
|
|
"code.gitea.io/gitea/models/organization"
|
|
|
|
@ -31,6 +32,7 @@ import (
|
|
|
|
|
"code.gitea.io/gitea/modules/validation"
|
|
|
|
|
"code.gitea.io/gitea/modules/web"
|
|
|
|
|
"code.gitea.io/gitea/routers/api/v1/utils"
|
|
|
|
|
actions_service "code.gitea.io/gitea/services/actions"
|
|
|
|
|
"code.gitea.io/gitea/services/context"
|
|
|
|
|
"code.gitea.io/gitea/services/convert"
|
|
|
|
|
"code.gitea.io/gitea/services/issue"
|
|
|
|
@ -1035,6 +1037,9 @@ func updateRepoArchivedState(ctx *context.APIContext, opts api.EditRepoOption) e
|
|
|
|
|
ctx.Error(http.StatusInternalServerError, "ArchiveRepoState", err)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if err := actions_model.CleanRepoScheduleTasks(ctx, repo); err != nil {
|
|
|
|
|
log.Error("CleanRepoScheduleTasks for archived repo %s/%s: %v", ctx.Repo.Owner.Name, repo.Name, err)
|
|
|
|
|
}
|
|
|
|
|
log.Trace("Repository was archived: %s/%s", ctx.Repo.Owner.Name, repo.Name)
|
|
|
|
|
} else {
|
|
|
|
|
if err := repo_model.SetArchiveRepoState(ctx, repo, *opts.Archived); err != nil {
|
|
|
|
@ -1042,6 +1047,11 @@ func updateRepoArchivedState(ctx *context.APIContext, opts api.EditRepoOption) e
|
|
|
|
|
ctx.Error(http.StatusInternalServerError, "ArchiveRepoState", err)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if ctx.Repo.Repository.UnitEnabled(ctx, unit_model.TypeActions) {
|
|
|
|
|
if err := actions_service.DetectAndHandleSchedules(ctx, repo); err != nil {
|
|
|
|
|
log.Error("DetectAndHandleSchedules for un-archived repo %s/%s: %v", ctx.Repo.Owner.Name, repo.Name, err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
log.Trace("Repository was un-archived: %s/%s", ctx.Repo.Owner.Name, repo.Name)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|