Skip to content

Commit 1f4b607

Browse files
authored
Merge branch 'main' into FixStatusCheckWhenRuleMatchMultiple
2 parents 16dce07 + c72e1a7 commit 1f4b607

40 files changed

+289
-185
lines changed

models/activities/action.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,14 @@ func (a *Action) GetCreate() time.Time {
393393
return a.CreatedUnix.AsTime()
394394
}
395395

396-
// GetIssueInfos returns a list of issues associated with
397-
// the action.
396+
// GetIssueInfos returns a list of associated information with the action.
398397
func (a *Action) GetIssueInfos() []string {
399-
return strings.SplitN(a.Content, "|", 3)
398+
// make sure it always returns 3 elements, because there are some access to the a[1] and a[2] without checking the length
399+
ret := strings.SplitN(a.Content, "|", 3)
400+
for len(ret) < 3 {
401+
ret = append(ret, "")
402+
}
403+
return ret
400404
}
401405

402406
// GetIssueTitle returns the title of first issue associated with the action.

public/assets/img/svg/gitea-bitbucket.svg

Lines changed: 1 addition & 1 deletion
Loading

public/assets/img/svg/gitea-facebook.svg

Lines changed: 1 addition & 1 deletion
Loading

public/assets/img/svg/gitea-jetbrains.svg

Lines changed: 1 addition & 0 deletions
Loading

public/assets/img/svg/gitea-microsoftonline.svg

Lines changed: 1 addition & 1 deletion
Loading

public/assets/img/svg/gitea-open-with-jetbrains.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/assets/img/svg/gitea-open-with-vscode.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/assets/img/svg/gitea-open-with-vscodium.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/assets/img/svg/gitea-vscode.svg

Lines changed: 1 addition & 0 deletions
Loading

public/assets/img/svg/gitea-vscodium.svg

Lines changed: 1 addition & 0 deletions
Loading

routers/api/v1/repo/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"code.gitea.io/gitea/routers/api/v1/utils"
1515
"code.gitea.io/gitea/services/context"
1616
"code.gitea.io/gitea/services/convert"
17-
files_service "code.gitea.io/gitea/services/repository/files"
17+
commitstatus_service "code.gitea.io/gitea/services/repository/commitstatus"
1818
)
1919

2020
// NewCommitStatus creates a new CommitStatus
@@ -64,7 +64,7 @@ func NewCommitStatus(ctx *context.APIContext) {
6464
Description: form.Description,
6565
Context: form.Context,
6666
}
67-
if err := files_service.CreateCommitStatus(ctx, ctx.Repo.Repository, ctx.Doer, sha, status); err != nil {
67+
if err := commitstatus_service.CreateCommitStatus(ctx, ctx.Repo.Repository, ctx.Doer, sha, status); err != nil {
6868
ctx.Error(http.StatusInternalServerError, "CreateCommitStatus", err)
6969
return
7070
}

0 commit comments

Comments
 (0)