Skip to content

Commit 8ea2482

Browse files
authored
Merge branch 'main' into feature/repo-keyboard-shortcuts
2 parents d14da9f + 1eced4a commit 8ea2482

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2665
-577
lines changed

.yamllint.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ rules:
2121
comments-indentation:
2222
level: error
2323

24-
document-start:
25-
level: error
26-
present: false
24+
document-start: disable
2725

2826
document-end:
2927
present: false

assets/go-licenses.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

custom/conf/app.example.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ INTERNAL_TOKEN =
521521
;; Set the two-factor auth behavior.
522522
;; Set to "enforced", to force users to enroll into Two-Factor Authentication, users without 2FA have no access to repositories via API or web.
523523
;TWO_FACTOR_AUTH =
524+
;;
525+
;; The value of the X-Frame-Options HTTP header for HTML responses. Use "unset" to remove the header.
526+
;X_FRAME_OPTIONS = SAMEORIGIN
524527

525528
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
526529
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1290,9 +1293,6 @@ LEVEL = Info
12901293
;;
12911294
;; headers to permit
12921295
;HEADERS = Content-Type,User-Agent
1293-
;;
1294-
;; set X-FRAME-OPTIONS header
1295-
;X_FRAME_OPTIONS = SAMEORIGIN
12961296

12971297
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12981298
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ require (
112112
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
113113
github.com/yuin/goldmark-meta v1.1.0
114114
gitlab.com/gitlab-org/api/client-go v0.142.4
115+
go.yaml.in/yaml/v4 v4.0.0-rc.2
115116
golang.org/x/crypto v0.47.0
116117
golang.org/x/image v0.35.0
117118
golang.org/x/net v0.49.0
@@ -294,7 +295,7 @@ ignore (
294295

295296
replace github.com/jaytaylor/html2text => github.com/Necoro/html2text v0.0.0-20250804200300-7bf1ce1c7347
296297

297-
replace github.com/nektos/act => gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763
298+
replace github.com/nektos/act => gitea.com/gitea/act v0.261.8
298299

299300
replace git.sr.ht/~mariusor/go-xsd-duration => gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078
300301

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
3131
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3232
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
3333
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
34-
gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763 h1:ohdxegvslDEllZmRNDqpKun6L4Oq81jNdEDtGgHEV2c=
35-
gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
34+
gitea.com/gitea/act v0.261.8 h1:rUWB5GOZOubfe2VteKb7XP3HRIbcW3UUmfh7bVAgQcA=
35+
gitea.com/gitea/act v0.261.8/go.mod h1:lTp4136rwbZiZS3ZVQeHCvd4qRAZ7LYeiRBqOSdMY/4=
3636
gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:BAFmdZpRW7zMQZQDClaCWobRj9uL1MR3MzpCVJvc5s4=
3737
gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs=
3838
gitea.com/go-chi/binding v0.0.0-20240430071103-39a851e106ed h1:EZZBtilMLSZNWtHHcgq2mt6NSGhJSZBuduAlinMEmso=
@@ -829,6 +829,8 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
829829
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
830830
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
831831
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
832+
go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s=
833+
go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
832834
go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc=
833835
go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU=
834836
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=

models/actions/run_job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111

1212
"code.gitea.io/gitea/models/db"
1313
repo_model "code.gitea.io/gitea/models/repo"
14+
"code.gitea.io/gitea/modules/actions/jobparser"
1415
"code.gitea.io/gitea/modules/timeutil"
1516
"code.gitea.io/gitea/modules/util"
1617

17-
"github.com/nektos/act/pkg/jobparser"
1818
"xorm.io/builder"
1919
)
2020

models/actions/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import (
1414
auth_model "code.gitea.io/gitea/models/auth"
1515
"code.gitea.io/gitea/models/db"
1616
"code.gitea.io/gitea/models/unit"
17+
"code.gitea.io/gitea/modules/actions/jobparser"
1718
"code.gitea.io/gitea/modules/log"
1819
"code.gitea.io/gitea/modules/setting"
1920
"code.gitea.io/gitea/modules/timeutil"
2021
"code.gitea.io/gitea/modules/util"
2122

2223
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
2324
lru "github.com/hashicorp/golang-lru/v2"
24-
"github.com/nektos/act/pkg/jobparser"
2525
"google.golang.org/protobuf/types/known/timestamppb"
2626
"xorm.io/builder"
2727
)

models/actions/task_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import (
77
"strings"
88
"testing"
99

10-
"github.com/nektos/act/pkg/jobparser"
10+
"code.gitea.io/gitea/modules/actions/jobparser"
11+
1112
"github.com/stretchr/testify/assert"
1213
)
1314

models/fixtures/attachment.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,16 @@
153153
download_count: 0
154154
size: 0
155155
created_unix: 946684800
156+
157+
-
158+
id: 13
159+
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a23
160+
repo_id: 1
161+
issue_id: 0
162+
release_id: 4
163+
uploader_id: 2
164+
comment_id: 0
165+
name: draft-attach
166+
download_count: 0
167+
size: 0
168+
created_unix: 946684800

models/git/branch.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func RenameBranch(ctx context.Context, repo *repo_model.Repository, from, to str
450450
type FindRecentlyPushedNewBranchesOptions struct {
451451
Repo *repo_model.Repository
452452
BaseRepo *repo_model.Repository
453-
CommitAfterUnix int64
453+
PushedAfterUnix int64
454454
MaxCount int
455455
}
456456

@@ -460,11 +460,11 @@ type RecentlyPushedNewBranch struct {
460460
BranchDisplayName string
461461
BranchLink string
462462
BranchCompareURL string
463-
CommitTime timeutil.TimeStamp
463+
PushedTime timeutil.TimeStamp
464464
}
465465

466466
// FindRecentlyPushedNewBranches return at most 2 new branches pushed by the user in 2 hours which has no opened PRs created
467-
// if opts.CommitAfterUnix is 0, we will find the branches that were committed to in the last 2 hours
467+
// if opts.PushedAfterUnix is 0, we will find the branches that were pushed in the last 2 hours
468468
// if opts.ListOptions is not set, we will only display top 2 latest branches.
469469
// Protected branches will be skipped since they are unlikely to be used to create new PRs.
470470
func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, opts FindRecentlyPushedNewBranchesOptions) ([]*RecentlyPushedNewBranch, error) {
@@ -492,8 +492,8 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
492492
}
493493
repoIDs := builder.Select("id").From("repository").Where(repoCond)
494494

495-
if opts.CommitAfterUnix == 0 {
496-
opts.CommitAfterUnix = time.Now().Add(-time.Hour * 2).Unix()
495+
if opts.PushedAfterUnix == 0 {
496+
opts.PushedAfterUnix = time.Now().Add(-time.Hour * 2).Unix()
497497
}
498498

499499
var ignoredCommitIDs []string
@@ -522,7 +522,7 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
522522
"pusher_id": doer.ID,
523523
"is_deleted": false,
524524
},
525-
builder.Gte{"commit_time": opts.CommitAfterUnix},
525+
builder.Gte{"updated_unix": opts.PushedAfterUnix},
526526
builder.In("repo_id", repoIDs),
527527
// newly created branch have no changes, so skip them
528528
builder.NotIn("commit_id", ignoredCommitIDs),
@@ -573,7 +573,7 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
573573
BranchName: branch.Name,
574574
BranchLink: fmt.Sprintf("%s/src/branch/%s", branch.Repo.Link(), util.PathEscapeSegments(branch.Name)),
575575
BranchCompareURL: branch.Repo.ComposeBranchCompareURL(opts.BaseRepo, baseTargetBranchName, branch.Name),
576-
CommitTime: branch.CommitTime,
576+
PushedTime: branch.UpdatedUnix,
577577
})
578578
}
579579
if len(newBranches) == opts.MaxCount {

0 commit comments

Comments
 (0)