chore: remove exp

This commit is contained in:
Jason Song
2023-01-10 10:37:20 +08:00
parent 3c2bffd818
commit 335873e1d8
4 changed files with 2 additions and 7 deletions

View File

@@ -18,7 +18,6 @@ import (
webhook_module "code.gitea.io/gitea/modules/webhook"
"github.com/nektos/act/pkg/jobparser"
"golang.org/x/exp/slices"
"xorm.io/builder"
)
@@ -230,7 +229,7 @@ func UpdateRun(ctx context.Context, run *ActionRun, cols ...string) error {
}
_, err := sess.Update(run)
if run.Status != 0 || slices.Contains(cols, "status") {
if run.Status != 0 || util.IsStringInSlice("status", cols) {
if run.RepoID == 0 {
run, err = GetRunByID(ctx, run.ID)
if err != nil {

View File

@@ -12,7 +12,6 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"golang.org/x/exp/slices"
"xorm.io/builder"
)
@@ -108,7 +107,7 @@ func UpdateRunJob(ctx context.Context, job *ActionRunJob, cond builder.Cond, col
return 0, err
}
if affected == 0 || (!slices.Contains(cols, "status") && job.Status == 0) {
if affected == 0 || (!util.IsStringInSlice("status", cols) && job.Status == 0) {
return affected, nil
}