Skip to content

Commit dcf0d8d

Browse files
committed
Merge branch 'main' into lunny/use_link_ui
2 parents 93bdd1a + 74466eb commit dcf0d8d

File tree

50 files changed

+243
-83
lines changed

Some content is hidden

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

50 files changed

+243
-83
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.18.3](https://github.com/go-gitea/gitea/releases/tag/v1.18.3) - 2023-01-23
8+
9+
* SECURITY
10+
* Prevent multiple `To` recipients (#22566) (#22569)
11+
* BUGFIXES
12+
* Truncate commit summary on repo files table. (#22551) (#22552)
13+
* Mute all links in issue timeline (#22534)
14+
15+
## [1.18.2](https://github.com/go-gitea/gitea/releases/tag/v1.18.2) - 2023-01-19
16+
17+
* BUGFIXES
18+
* Fix issue not auto-closing when it includes a reference to a branch (#22514) (#22521)
19+
* Fix invalid issue branch reference if not specified in template (#22513) (#22520)
20+
* Fix 500 error viewing pull request when fork has pull requests disabled (#22512) (#22515)
21+
* Reliable selection of admin user (#22509) (#22511)
22+
* Set disable_gravatar/enable_federated_avatar when offline mode is true (#22479) (#22496)
23+
* BUILD
24+
* cgo cross-compile for freebsd (#22397) (#22519)
25+
726
## [1.18.1](https://github.com/go-gitea/gitea/releases/tag/v1.18.1) - 2023-01-17
827

928
* API

DCO

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ Developer Certificate of Origin
22
Version 1.1
33

44
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5-
660 York Street, Suite 102,
6-
San Francisco, CA 94110 USA
75

86
Everyone is permitted to copy and distribute verbatim copies of this
97
license document, but changing it is not allowed.
@@ -33,4 +31,4 @@ By making a contribution to this project, I certify that:
3331
are public and that a record of the contribution (including all
3432
personal information I submit with it, including my sign-off) is
3533
maintained indefinitely and may be redistributed consistent with
36-
this project or the open source license(s) involved.
34+
this project or the open source license(s) involved.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
1313
<img src="https://img.shields.io/discord/322538954119184384.svg">
1414
</a>
15-
<a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
15+
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
1616
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
1717
</a>
1818
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
1919
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
2020
</a>
21-
<a href="https://godoc.org/code.gitea.io/gitea" title="GoDoc">
22-
<img src="https://godoc.org/code.gitea.io/gitea?status.svg">
21+
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
22+
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
2323
</a>
2424
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
2525
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
@@ -45,7 +45,7 @@
4545
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
4646
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
4747
</a>
48-
<a href="https://www.bountysource.com/teams/gitea" title="Bountysource">
48+
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
4949
<img src="https://img.shields.io/bountysource/team/gitea/activity">
5050
</a>
5151
</p>

README_ZH.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
1313
<img src="https://img.shields.io/discord/322538954119184384.svg">
1414
</a>
15-
<a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
15+
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
1616
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
1717
</a>
1818
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
1919
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
2020
</a>
21-
<a href="https://godoc.org/code.gitea.io/gitea" title="GoDoc">
22-
<img src="https://godoc.org/code.gitea.io/gitea?status.svg">
21+
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
22+
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
2323
</a>
2424
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
2525
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
@@ -45,7 +45,7 @@
4545
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
4646
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
4747
</a>
48-
<a href="https://img.shields.io/bountysource/team/gitea" title="Bountysource">
48+
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
4949
<img src="https://img.shields.io/bountysource/team/gitea/activity">
5050
</a>
5151
</p>

custom/conf/app.example.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ ROUTER = console
17211721
;INTERVAL = 60
17221722
;;
17231723
;; For "redis" and "memcache", connection host address
1724-
;; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
1724+
;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
17251725
;; memcache: `127.0.0.1:11211`
17261726
;; twoqueue: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000`
17271727
;HOST =
@@ -1760,7 +1760,7 @@ ROUTER = console
17601760
;; Provider config options
17611761
;; memory: doesn't have any config yet
17621762
;; file: session file path, e.g. `data/sessions`
1763-
;; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
1763+
;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
17641764
;; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
17651765
;PROVIDER_CONFIG = data/sessions ; Relative paths will be made absolute against _`AppWorkPath`_.
17661766
;;
@@ -2380,8 +2380,8 @@ ROUTER = console
23802380
;QUEUE_LENGTH = 1000
23812381
;;
23822382
;; Task queue connection string, available only when `QUEUE_TYPE` is `redis`.
2383-
;; If there is a password of redis, use `addrs=127.0.0.1:6379 password=123 db=0`.
2384-
;QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
2383+
;; If there is a password of redis, use `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`.
2384+
;QUEUE_CONN_STR = "redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s"
23852385

23862386
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23872387
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/features/comparison.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ _Symbols used in table:_
7474
| Granular user roles (Code, Issues, Uncyclo, …) ||||||||
7575
| Verified Committer ||| ? |||||
7676
| GPG Signed Commits ||||||||
77-
| SSH Signed Commits |||| | | ? | ? |
77+
| SSH Signed Commits |||| | | ? | ? |
7878
| Reject unsigned commits ||||||||
7979
| Migrating repos from other services ||||||||
8080
| Repository Activity page ||||||||

docs/content/doc/packages/pypi.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ For example:
7777
pip install --index-url https://testuser:[email protected]/api/packages/testuser/pypi/simple --no-deps test_package
7878
```
7979

80+
You can use `--extra-index-url` instead of `--index-url` but that makes you vulnerable to dependency confusion attacks because `pip` checks the official PyPi repository for the package before it checks the specified custom repository. Read the `pip` docs for more information.
81+
8082
## Supported commands
8183

8284
```

models/project/project.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ func (p *Project) Link() string {
123123
log.Error("LoadOwner: %v", err)
124124
return ""
125125
}
126-
return fmt.Sprintf("/%s/-/projects/%d", p.Owner.Name, p.ID)
126+
return fmt.Sprintf("%s/-/projects/%d", p.Owner.HomeLink(), p.ID)
127127
}
128128
if p.RepoID > 0 {
129129
err := p.LoadRepo(db.DefaultContext)
130130
if err != nil {
131131
log.Error("LoadRepo: %v", err)
132132
return ""
133133
}
134-
return fmt.Sprintf("/%s/projects/%d", p.Repo.RepoPath(), p.ID)
134+
return fmt.Sprintf("%s/projects/%d", p.Repo.Link(), p.ID)
135135
}
136136
return ""
137137
}

models/user/setting.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"code.gitea.io/gitea/models/db"
1212
"code.gitea.io/gitea/modules/cache"
13+
setting_module "code.gitea.io/gitea/modules/setting"
1314

1415
"xorm.io/builder"
1516
)
@@ -154,11 +155,16 @@ func SetUserSetting(userID int64, key, value string) error {
154155
return err
155156
}
156157

157-
_, err := cache.GetString(genSettingCacheKey(userID, key), func() (string, error) {
158-
return value, upsertUserSettingValue(userID, key, value)
159-
})
158+
if err := upsertUserSettingValue(userID, key, value); err != nil {
159+
return err
160+
}
160161

161-
return err
162+
cc := cache.GetCache()
163+
if cc != nil {
164+
return cc.Put(genSettingCacheKey(userID, key), value, setting_module.CacheService.TTLSeconds())
165+
}
166+
167+
return nil
162168
}
163169

164170
func upsertUserSettingValue(userID int64, key, value string) error {

modules/issue/template/template.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ func (f *valuedField) WriteTo(builder *strings.Builder) {
259259
}
260260

261261
// write label
262-
_, _ = fmt.Fprintf(builder, "### %s\n\n", f.Label())
262+
if !f.HideLabel() {
263+
_, _ = fmt.Fprintf(builder, "### %s\n\n", f.Label())
264+
}
263265

264266
blankPlaceholder := "_No response_\n"
265267

@@ -311,6 +313,13 @@ func (f *valuedField) Label() string {
311313
return ""
312314
}
313315

316+
func (f *valuedField) HideLabel() bool {
317+
if label, ok := f.Attributes["hide_label"].(bool); ok {
318+
return label
319+
}
320+
return false
321+
}
322+
314323
func (f *valuedField) Render() string {
315324
if render, ok := f.Attributes["render"].(string); ok {
316325
return render

modules/issue/template/template_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ body:
640640
description: Description of input
641641
placeholder: Placeholder of input
642642
value: Value of input
643+
hide_label: true
643644
validations:
644645
required: true
645646
is_number: true
@@ -681,8 +682,6 @@ body:
681682
682683
` + "```bash\nValue of id2\n```" + `
683684
684-
### Label of input
685-
686685
Value of id3
687686
688687
### Label of dropdown

modules/migration/file_format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func validate(bs []byte, datatype interface{}, isJSON bool) error {
7676
}
7777
err = sch.Validate(v)
7878
if err != nil {
79-
log.Error("migration validation with %s failed for\n%s", schemaFilename, string(bs))
79+
log.Error("migration validation with %s failed:\n%#v", schemaFilename, err)
8080
}
8181
return err
8282
}

modules/notification/action/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (a *actionNotifier) NotifyNewIssue(ctx context.Context, issue *issues_model
5656
}
5757

5858
// NotifyIssueChangeStatus notifies close or reopen issue to notifiers
59-
func (a *actionNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, closeOrReopen bool) {
59+
func (a *actionNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, closeOrReopen bool) {
6060
// Compose comment action, could be plain comment, close or reopen issue/pull request.
6161
// This object will be used to notify watchers in the end of function.
6262
act := &activities_model.Action{

modules/notification/base/notifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Notifier interface {
2323
NotifyRenameRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, oldRepoName string)
2424
NotifyTransferRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, oldOwnerName string)
2525
NotifyNewIssue(ctx context.Context, issue *issues_model.Issue, mentions []*user_model.User)
26-
NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, closeOrReopen bool)
26+
NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, closeOrReopen bool)
2727
NotifyDeleteIssue(ctx context.Context, doer *user_model.User, issue *issues_model.Issue)
2828
NotifyIssueChangeMilestone(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldMilestoneID int64)
2929
NotifyIssueChangeAssignee(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment)

modules/notification/base/null.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (*NullNotifier) NotifyNewIssue(ctx context.Context, issue *issues_model.Iss
3232
}
3333

3434
// NotifyIssueChangeStatus places a place holder function
35-
func (*NullNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
35+
func (*NullNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
3636
}
3737

3838
// NotifyDeleteIssue notify when some issue deleted

modules/notification/mail/mail.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (m *mailNotifier) NotifyNewIssue(ctx context.Context, issue *issues_model.I
5454
}
5555
}
5656

57-
func (m *mailNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
57+
func (m *mailNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
5858
var actionType activities_model.ActionType
5959
if issue.IsPull {
6060
if isClosed {

modules/notification/notification.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ func NotifyNewIssue(ctx context.Context, issue *issues_model.Issue, mentions []*
7777
}
7878

7979
// NotifyIssueChangeStatus notifies close or reopen issue to notifiers
80-
func NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, closeOrReopen bool) {
80+
func NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, closeOrReopen bool) {
8181
for _, notifier := range notifiers {
82-
notifier.NotifyIssueChangeStatus(ctx, doer, issue, actionComment, closeOrReopen)
82+
notifier.NotifyIssueChangeStatus(ctx, doer, commitID, issue, actionComment, closeOrReopen)
8383
}
8484
}
8585

modules/notification/ui/ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (ns *notificationService) NotifyNewIssue(ctx context.Context, issue *issues
9393
}
9494
}
9595

96-
func (ns *notificationService) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
96+
func (ns *notificationService) NotifyIssueChangeStatus(ctx context.Context, doer *user_model.User, commitID string, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
9797
_ = ns.issueQueue.Push(issueNotificationOpts{
9898
IssueID: issue.ID,
9999
NotificationAuthorID: doer.ID,

modules/structs/hook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ type IssuePayload struct {
352352
Issue *Issue `json:"issue"`
353353
Repository *Repository `json:"repository"`
354354
Sender *User `json:"sender"`
355+
CommitID string `json:"commit_id"`
355356
}
356357

357358
// JSONPayload encodes the IssuePayload to JSON, with an indentation of two spaces.
@@ -386,6 +387,7 @@ type PullRequestPayload struct {
386387
PullRequest *PullRequest `json:"pull_request"`
387388
Repository *Repository `json:"repository"`
388389
Sender *User `json:"sender"`
390+
CommitID string `json:"commit_id"`
389391
Review *ReviewPayload `json:"review"`
390392
}
391393

routers/api/v1/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ func Routes(ctx gocontext.Context) *web.Route {
10111011
m.Group("/releases", func() {
10121012
m.Combo("").Get(repo.ListReleases).
10131013
Post(reqToken(auth_model.AccessTokenScopeRepo), reqRepoWriter(unit.TypeReleases), context.ReferencesGitRepo(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
1014+
m.Combo("/latest").Get(repo.GetLatestRelease)
10141015
m.Group("/{id}", func() {
10151016
m.Combo("").Get(repo.GetRelease).
10161017
Patch(reqToken(auth_model.AccessTokenScopeRepo), reqRepoWriter(unit.TypeReleases), context.ReferencesGitRepo(), bind(api.EditReleaseOption{}), repo.EditRelease).

routers/api/v1/repo/issue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ func CreateIssue(ctx *context.APIContext) {
654654
}
655655

656656
if form.Closed {
657-
if err := issue_service.ChangeStatus(issue, ctx.Doer, true); err != nil {
657+
if err := issue_service.ChangeStatus(issue, ctx.Doer, "", true); err != nil {
658658
if issues_model.IsErrDependenciesLeft(err) {
659659
ctx.Error(http.StatusPreconditionFailed, "DependenciesLeft", "cannot close this issue because it still has open dependencies")
660660
return
@@ -826,7 +826,7 @@ func EditIssue(ctx *context.APIContext) {
826826
}
827827

828828
if statusChangeComment != nil {
829-
notification.NotifyIssueChangeStatus(ctx, ctx.Doer, issue, statusChangeComment, issue.IsClosed)
829+
notification.NotifyIssueChangeStatus(ctx, ctx.Doer, "", issue, statusChangeComment, issue.IsClosed)
830830
}
831831

832832
// Refetch from database to assign some automatic values

routers/api/v1/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ func EditPullRequest(ctx *context.APIContext) {
600600
}
601601

602602
if statusChangeComment != nil {
603-
notification.NotifyIssueChangeStatus(ctx, ctx.Doer, issue, statusChangeComment, issue.IsClosed)
603+
notification.NotifyIssueChangeStatus(ctx, ctx.Doer, "", issue, statusChangeComment, issue.IsClosed)
604604
}
605605

606606
// change pull target branch

routers/api/v1/repo/release.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,47 @@ func GetRelease(ctx *context.APIContext) {
6767
ctx.JSON(http.StatusOK, convert.ToRelease(release))
6868
}
6969

70+
// GetLatestRelease gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at
71+
func GetLatestRelease(ctx *context.APIContext) {
72+
// swagger:operation GET /repos/{owner}/{repo}/releases/latest repository repoGetLatestRelease
73+
// ---
74+
// summary: Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at
75+
// produces:
76+
// - application/json
77+
// parameters:
78+
// - name: owner
79+
// in: path
80+
// description: owner of the repo
81+
// type: string
82+
// required: true
83+
// - name: repo
84+
// in: path
85+
// description: name of the repo
86+
// type: string
87+
// required: true
88+
// responses:
89+
// "200":
90+
// "$ref": "#/responses/Release"
91+
// "404":
92+
// "$ref": "#/responses/notFound"
93+
release, err := repo_model.GetLatestReleaseByRepoID(ctx.Repo.Repository.ID)
94+
if err != nil && !repo_model.IsErrReleaseNotExist(err) {
95+
ctx.Error(http.StatusInternalServerError, "GetLatestRelease", err)
96+
return
97+
}
98+
if err != nil && repo_model.IsErrReleaseNotExist(err) ||
99+
release.IsTag || release.RepoID != ctx.Repo.Repository.ID {
100+
ctx.NotFound()
101+
return
102+
}
103+
104+
if err := release.LoadAttributes(ctx); err != nil {
105+
ctx.Error(http.StatusInternalServerError, "LoadAttributes", err)
106+
return
107+
}
108+
ctx.JSON(http.StatusOK, convert.ToRelease(release))
109+
}
110+
70111
// ListReleases list a repository's releases
71112
func ListReleases(ctx *context.APIContext) {
72113
// swagger:operation GET /repos/{owner}/{repo}/releases repository repoListReleases

0 commit comments

Comments
 (0)