aboutsummaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Move web JSON functions to web context and simplify code (#26132)wxiaoguang2023-07-2634-184/+63
| | | | | | | | | The JSONRedirect/JSONOK/JSONError functions were put into "Base" context incorrectly, it would cause abuse. Actually, they are for "web context" only, so, move them to the correct place. And by the way, use them to simplify old code: +75 -196
* Display deprecated warning in admin panel pages as well as in the log file ↵Lunny Xiao2023-07-262-0/+13
| | | | | | | | | | | | | | | (#26094) This PR includes #26007 's changes but have a UI to prompt administrator about the deprecated settings as well as the log or console warning. Then users will have enough time to notice the problem and don't have surprise like before. <img width="1293" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/c33355f0-1ea7-4fb3-ad43-cd23cd15391d"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove "misc" scope check from public API endpoints (#26134)wxiaoguang2023-07-261-2/+2
| | | Fix #26035
* Allow Organisations to have a E-Mail (#25082)JakobDev2023-07-252-1/+12
| | | | | | | | | | | | | | | | | | | | Resolves #25057 This adds a E-Mail field to Organisations. The E-Mail is just shown on the Profile when it is visited by a logged in User. The E-mail is not used for something else. **Screenshots:** ![grafik](https://github.com/go-gitea/gitea/assets/15185051/a8d622b3-7278-4c08-984b-9c5ebfdb5471) ![grafik](https://github.com/go-gitea/gitea/assets/15185051/6dcb1dd7-d04b-49eb-bc96-6582cfe9757b) --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: Denys Konovalov <privat@denyskon.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Implement auto-cancellation of concurrent jobs if the event is push (#25716)Bo-Yi Wu2023-07-251-4/+8
| | | | | | | | | | | | | | | | | | - cancel running jobs if the event is push - Add a new function `CancelRunningJobs` to cancel all running jobs of a run - Update `FindRunOptions` struct to include `Ref` field and update its condition in `toConds` function - Implement auto cancellation of running jobs in the same workflow in `notify` function related task: https://github.com/go-gitea/gitea/pull/22751/ --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Signed-off-by: appleboy <appleboy.tw@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: delvh <dev.lh@web.de>
* Fix handling of Debian files with trailing slash (#26087)KN4CK3R2023-07-241-1/+1
| | | | | | | Fixes #26022 - Fix handling of files with trailing slash - Fix handling of duplicate package file errors - Added test for both
* fix Missing 404 swagger response docs for /admin/users/{username} (#26086)caicandong2023-07-241-0/+2
| | | close #26079
* Reduce unnecessary DB queries for Actions tasks (#25199)sillyguodong2023-07-241-7/+26
| | | | | | | | | | | | | | | | | | | | | | | Close #24544 Changes: - Create `action_tasks_version` table to store the latest version of each scope (global, org and repo). - When a job with the status of `waiting` is created, the tasks version of the scopes it belongs to will increase. - When the status of a job already in the database is updated to `waiting`, the tasks version of the scopes it belongs to will increase. - On Gitea side, in `FeatchTask()`, will try to query the `action_tasks_version` record of the scope of the runner that call `FetchTask()`. If the record does not exist, will insert a row. Then, Gitea will compare the version passed from runner to Gitea with the version in database, if inconsistent, try pick task. Gitea always returns the latest version from database to the runner. Related: - Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10 - Runner: https://gitea.com/gitea/act_runner/pulls/219
* Remove `db.DefaultContext` in `routers/` and `cmd/` (#26076)delvh2023-07-2310-124/+116
| | | | | | Now, the only remaining usages of `models.db.DefaultContext` are in - `modules` - `models` - `services`
* Add context parameter to some database functions (#26055)Lunny Xiao2023-07-2222-63/+63
| | | | | To avoid deadlock problem, almost database related functions should be have ctx as the first parameter. This PR do a refactor for some of these functions.
* Fix branch list auth (#26041)Lunny Xiao2023-07-221-1/+1
| | | | | The public repositories' branch list dropdown will return wrong because it requires login wrongly. Caused by #25719
* Serve pre-defined files in "public", add "security.txt", add CORS header for ↵wxiaoguang2023-07-213-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ".well-known" (#25974) Replace #25892 Close #21942 Close #25464 Major changes: 1. Serve "robots.txt" and ".well-known/security.txt" in the "public" custom path * All files in "public/.well-known" can be served, just like "public/assets" 3. Add a test for ".well-known/security.txt" 4. Simplify the "FileHandlerFunc" logic, now the paths are consistent so the code can be simpler 5. Add CORS header for ".well-known" endpoints 6. Add logs to tell users they should move some of their legacy custom public files ``` 2023/07/19 13:00:37 cmd/web.go:178:serveInstalled() [E] Found legacy public asset "img" in CustomPath. Please move it to /work/gitea/custom/public/assets/img 2023/07/19 13:00:37 cmd/web.go:182:serveInstalled() [E] Found legacy public asset "robots.txt" in CustomPath. Please move it to /work/gitea/custom/public/robots.txt ``` This PR is not breaking. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Use frontend fetch for branch dropdown component (#25719)HesterG2023-07-217-10/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Send request to get branch/tag list, use loading icon when waiting for response. - Only fetch when the first time branch/tag list shows. - For backend, removed assignment to `ctx.Data["Branches"]` and `ctx.Data["Tags"]` from `context/repo.go` and passed these data wherever needed. - Changed some `v-if` to `v-show` and used native `svg` as mentioned in https://github.com/go-gitea/gitea/pull/25719#issuecomment-1631712757 to improve perfomance when there are a lot of branches. - Places Used the dropdown component: Repo Home Page <img width="1429" alt="Screen Shot 2023-07-06 at 12 17 51" src="https://github.com/go-gitea/gitea/assets/17645053/6accc7b6-8d37-4e88-ae1a-bd2b3b927ea0"> Commits Page <img width="1431" alt="Screen Shot 2023-07-06 at 12 18 34" src="https://github.com/go-gitea/gitea/assets/17645053/2d0bf306-d1e2-45a8-a784-bc424879f537"> Specific commit -> operations -> cherry-pick <img width="758" alt="Screen Shot 2023-07-06 at 12 23 28" src="https://github.com/go-gitea/gitea/assets/17645053/1e557948-3881-4e45-a625-8ef36d45ae2d"> Release Page <img width="1433" alt="Screen Shot 2023-07-06 at 12 25 05" src="https://github.com/go-gitea/gitea/assets/17645053/3ec82af1-15a4-4162-a50b-04a9502161bb"> - Demo https://github.com/go-gitea/gitea/assets/17645053/d45d266b-3eb0-465a-82f9-57f78dc5f9f3 - Note: UI of dropdown menu could be improved in another PR as it should apply to more dropdown menus. Fix #14180 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support copy protected branch from template repository (#25889)Lunny Xiao2023-07-212-19/+21
| | | Fix #14303
* Actions Artifacts support uploading multiple files and directories (#24874)FuXiaoHei2023-07-215-294/+423
| | | | | | | | | | | | | | current actions artifacts implementation only support single file artifact. To support multiple files uploading, it needs: - save each file to each db record with same run-id, same artifact-name and proper artifact-path - need change artifact uploading url without artifact-id, multiple files creates multiple artifact-ids - support `path` in download-artifact action. artifact should download to `{path}/{artifact-path}`. - in repo action view, it provides zip download link in artifacts list in summary page, no matter this artifact contains single or multiple files.
* Remove redundant "RouteMethods" method (#26024)wxiaoguang2023-07-213-10/+10
| | | | | | The `RouteMethods` is mainly an alias for `Methods` with different argument order. Remove it to keep the "route.go" code clear
* Fix the route for pull-request's authors (#26016)wxiaoguang2023-07-202-5/+11
| | | | | | | | | | | | | | | Close #25906 ![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3) Succeeded logs: ``` [I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters) [I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters) ```
* Add a link to OpenID Issuer URL in WebFinger response (#26000)Noah Snelson2023-07-201-0/+4
| | | | | | | | | | | This change adds an entry to the `links` field of the `/.well-known/webfinger` response. The new entry points to the `appURL` as an OpenID issuer. This is consistent with the output of `/.well-known/openid-configuration`, which also uses the value of `appURL`. This change is required for Tailscale SSO to work, as it uses the OpenID Issuer URL when querying the Tailscale user email during signup/login ([docs](https://tailscale.com/kb/1240/sso-custom-oidc/#webfinger-setup)).
* Improve profile readme rendering (#25988)Earl Warren2023-07-191-1/+5
| | | | | | | | | - Tell the renderer to use the `document` mode, so it's consistent with other renderers. - Use the same padding as `.file-view.markup`, so it's consistent with other containers that contain markup rendering. - Resolves https://codeberg.org/forgejo/forgejo/issues/833 Co-authored-by: Gusted <postmaster@gusted.xyz>
* parseScope with owner/repo always sets owner to zero (#25987)Earl Warren2023-07-191-1/+2
| | | Refs: https://codeberg.org/forgejo/forgejo/pulls/1001
* Bump github.com/golang-jwt/jwt to v5 (#25975)harryzcy2023-07-192-13/+11
| | | | | | | | | | | | | | | | Bumping `github.com/golang-jwt/jwt` from v4 to v5. `github.com/golang-jwt/jwt` v5 is bringing some breaking changes: - standard `Valid()` method on claims is removed. It's replaced by `ClaimsValidator` interface implementing `Validator()` method instead, which is called after standard validation. Gitea doesn't seem to be using this logic. - `jwt.Token` has a field `Valid`, so it's checked in `ParseToken` function in `services/auth/source/oauth2/token.go` --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Update path related documents (#25417)wxiaoguang2023-07-191-1/+1
| | | | | | | | | | | | Update WorkPath/WORK_PATH related documents, remove out-dated information. Remove "StaticRootPath" on the admin config display page, because few end user really need it, it only causes misconfiguration. ![image](https://github.com/go-gitea/gitea/assets/2114189/8095afa4-da76-436b-9e89-2a92c229c01d) Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor "Content" for file uploading (#25851)wxiaoguang2023-07-182-26/+43
| | | | | | | | | | | | | | | Before: the concept "Content string" is used everywhere. It has some problems: 1. Sometimes it means "base64 encoded content", sometimes it means "raw binary content" 2. It doesn't work with large files, eg: uploading a 1G LFS file would make Gitea process OOM This PR does the refactoring: use "ContentReader" / "ContentBase64" instead of "Content" This PR is not breaking because the key in API JSON is still "content": `` ContentBase64 string `json:"content"` ``
* Ignore `runs-on` with expressions when warning no matched runners (#25917)Jason Song2023-07-171-0/+7
| | | | | Fix #25905 Co-authored-by: Giteabot <teabot@gitea.io>
* Fix incorrect milestone count when provide a keyword (#25880)yp053272023-07-161-10/+9
| | | | | | | You can confirm this issue in: https://try.gitea.io/yp05327/testrepo/milestones?state=open&q=a There's no milestone, but the count is 1. ![image](https://github.com/go-gitea/gitea/assets/18380374/25e58cee-aeeb-43c1-8ec8-6e2ec6bf1284)
* Avoid opening/closing PRs which are already merged (#25883)yp053272023-07-151-0/+8
| | | | | | | | | | | We can select PRs to open/close them by one click, but we forgot to check whether it is merged. You can get an opening merged PR: ![image](https://github.com/go-gitea/gitea/assets/18380374/22c2e747-4bb9-4742-a9aa-ef39d5308bc5) You can confirm this in: https://try.gitea.io/yp05327/testrepo/pulls/5
* Fix "Flash" message usage (#25895)wxiaoguang2023-07-151-5/+2
| | | Resolve https://github.com/go-gitea/gitea/pull/25820/files#r1264309059
* Add support for different Maven POM encoding (#25873)KN4CK3R2023-07-141-1/+7
| | | | | | Fixes #25853 - Maven POM files aren't always UTF-8 encoded. - Reject the upload of unparsable POM files
* Fix incorrect release count (#25879)yp053272023-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | Release count is not correct: https://try.gitea.io/yp05327/testrepo/tags ![image](https://github.com/go-gitea/gitea/assets/18380374/07f97c62-d450-4ccb-b3f2-3e0af9d9fc52) https://try.gitea.io/yp05327/testrepo/releases ![image](https://github.com/go-gitea/gitea/assets/18380374/6f1d55a4-bb68-445d-84b9-90552a40f403) https://try.gitea.io/yp05327/testrepo/releases/tag/testtag ![image](https://github.com/go-gitea/gitea/assets/18380374/09ab5d51-52b6-4621-a571-3100198eb260) We already have correct release count, no need to calculate it again. https://github.com/go-gitea/gitea/blob/c5e187c389b35b9e080a3187b93a775a3c81e585/modules/context/repo.go#L547 Co-authored-by: Giteabot <teabot@gitea.io>
* Add error info if no user can fork the repo (#25820)yp053272023-07-141-0/+6
| | | | | | | | | Before: (Owner list is empty) ![image](https://github.com/go-gitea/gitea/assets/18380374/dbe87bfe-14ed-4997-8cb2-5c1308232a70) After: (Disable the button and show the error info) ![image](https://github.com/go-gitea/gitea/assets/18380374/a7e4c315-67ab-408b-88f2-c554076ce87a)
* fix incorrect repo url when changed the case of ownername (#25733)hiifong2023-07-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | When only the case of the username changes and the new username is consistent with the lowercase username of the old user name, update the owner name of the repo, and keep the original logic consistent with other conditions. example: your username is `gitea`, lowercase username is `gitea`,repo url is `.../gitea/{repo}`, you changed username to `Gitea` or `GiTea` or other, but the lowercase username is still `gitea`, the repo url is still `.../gitea/{repo}`. this pr fixed it,keep username and repo url consistent. Before: ![image](https://github.com/go-gitea/gitea/assets/89133723/84177296-f0ff-4176-84f1-1f9ec3f5b86f) ![image](https://github.com/go-gitea/gitea/assets/89133723/8f8f4a12-ecdd-4dec-af89-85c009b0ccfe) After: ![image](https://github.com/go-gitea/gitea/assets/89133723/0564edb6-9467-405a-8cd4-d6f70e6f614b) ![image](https://github.com/go-gitea/gitea/assets/89133723/554ecd6e-e5a1-43bc-a46d-99e988c2ff58)
* move issue filters to shared template (#25729)Denys Konovalov2023-07-131-1/+2
| | | | | | | | | | | | | | | | Issue filters are being used on repo list page and on milestone issues page, and the code is mostly duplicated. This PR does the following changes: - move issue filters into a shared template - allow filtering milestone issues by project, so no need to hide this filter on milestone issues page - remove some dead code (e. g. issue actions in milestone issues template) - fix label filter dropdown width --------- Co-authored-by: 6543 <6543@obermui.de>
* Fix empty project displayed in issue sidebar (#25802)yp053272023-07-122-4/+2
| | | | | | | | | | | | | | | | | | | | | | | Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4) This issue comes from the change in #25468. `LoadProject` will always return at least one record, so we use `ProjectID` to check whether an issue is linked to a project in the old code. As other `issue.LoadXXX` functions, we need to check the return value from `xorm.Session.Get`. In recent unit tests, we only test `issueList.LoadAttributes()` but don't test `issue.LoadAttributes()`. So I added a new test for `issue.LoadAttributes()` in this PR. --------- Co-authored-by: Denys Konovalov <privat@denyskon.de>
* Show correct SSL Mode on "install page" (#25818)wxiaoguang2023-07-111-0/+1
|
* Fix incorrect oldest sort in project list (#25806)yp053272023-07-112-2/+2
| | | | sort type `oldest` should be `Asc`. Added a test for this.
* Exclude default branch from pushed branch hint (#25795)Lunny Xiao2023-07-101-1/+1
| | | | | | | | When pushing to default branch, no pushing hint should be prompt. Fix #25778 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* For API attachments, use API URL (#25639)Lunny Xiao2023-07-108-36/+36
| | | | | | | Fix #25257 --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Show edit title button on commits tab of PR, too (#25791)sebastian-sauer2023-07-101-0/+3
| | | | | | | | | | | | | | | | | | | | | All 3 tabs of the PR (Conversation, Commits and Files changed) should show the edit title button. Before this commit the edit button was not shown on commits tab Screenshots: After: ![image](https://github.com/go-gitea/gitea/assets/1135157/d04c700c-dffc-4bcd-8108-cb64838af0c6) Before: ![image](https://github.com/go-gitea/gitea/assets/1135157/b6795ad3-c994-461c-98aa-a7331c3e3877) Just for reference the edit button in files changed tab: ![image](https://github.com/go-gitea/gitea/assets/1135157/5750640d-489f-4a71-8144-543ef42afb42) Co-authored-by: Giteabot <teabot@gitea.io>
* Make "install page" respect environment config (#25648)wxiaoguang2023-07-091-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Replace #25580 Fix #19453 The problem was: when users set "GITEA__XXX__YYY" , the "install page" doesn't respect it. So, to make the result consistent and avoid surprising end users, now the "install page" also writes the environment variables to the config file. And, to make things clear, there are enough messages on the UI to tell users what will happen. There are some necessary/related changes to `environment-to-ini.go`: * The "--clear" flag is removed and it was incorrectly written there. The "clear" operation should be done if INSTALL_LOCK=true * The "--prefix" flag is removed because it's never used, never documented and it only causes inconsistent behavior. ![image](https://github.com/go-gitea/gitea/assets/2114189/12778ee4-3fb5-4664-a73a-41ebbd77cd5b)
* Fix notification list bugs (#25781)wxiaoguang2023-07-091-1/+1
| | | | | | | | | Fix #25627 1. `ctx.Data["Link"]` should use relative URL but not AppURL 2. The `data-params` is incorrect because it doesn't contain "page". JS can simply use "window.location.search" to construct the AJAX URL 3. The `data-xxx` and `id` in notification_subscriptions.tmpl were copied&pasted, they don't have affect.
* Update tool dependencies, lock govulncheck and actionlint (#25655)silverwind2023-07-091-13/+9
| | | | | | | | | | - Update all tool dependencies - Lock `govulncheck` and `actionlint` to their latest tags --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Test if container blob is accessible before mounting (#22759)KN4CK3R2023-07-091-7/+15
| | | | | | | | | | related #16865 This PR adds an accessibility check before mounting container blobs. --------- Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: silverwind <me@silverwind.io>
* Newly pushed branches hints on repository home page (#25715)Lunny Xiao2023-07-081-0/+12
| | | | | | | | | | | | | This PR will display a pull request creation hint on the repository home page when there are newly created branches with no pull request. Only the recent 6 hours and 2 updated branches will be displayed. Inspired by #14003 Replace #14003 Resolves #311 Resolves #13196 Resolves #23743 co-authored by @kolaente
* Fix `ref` for workflows triggered by `pull_request_target` (#25743)Zettat1232023-07-071-3/+13
| | | | | | | | | | Follow #25229 At present, when the trigger event is `pull_request_target`, the `ref` and `sha` of `ActionRun` are set according to the base branch of the pull request. This makes it impossible for us to find the head branch of the `ActionRun` directly. In this PR, the `ref` and `sha` will always be set to the head branch and they will be changed to the base branch when generating the task context.
* Add open/closed field support for issue index (#25708)techknowlogick2023-07-073-6/+6
| | | | | | A couple of notes: * Future changes should refactor arguments into a struct * This filtering only is supported by meilisearch right now * Issue index number is bumped which will cause a re-index
* Following up fixes for "Fix inconsistent user profile layout across tabs" ↵wxiaoguang2023-07-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | (#25739) Follow https://github.com/go-gitea/gitea/pull/25625#issuecomment-1621577816 1. Fix the incorrect "project view" layout 2. Fix the "follow/unfollow" link on "packages" and "projects" tab Before: ![image](https://github.com/go-gitea/gitea/assets/2114189/3b071235-c186-4097-8a19-dd90dcb2a344) After: ![image](https://github.com/go-gitea/gitea/assets/2114189/d1d23cd7-28d8-43e3-9f68-03e8a34a9b97) --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Less naked returns (#25713)65432023-07-0710-67/+70
| | | | | just a step towards #25655 and some related refactoring
* Fix inconsistent user profile layout across tabs (#25625)puni98692023-07-066-128/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix ::User Profile Page Project Tab Have Inconsistent Layout and Style Added the big_avator for consistency in the all header_items tabs. Fixes: #24871 > ### Description > in the user profile page the `Packages` and `Projects` tab have small icons for user but other tabs have bigger profile picture with user info: > > ### Screenshots > ### **For Packages And Projects:** > ![image](https://user-images.githubusercontent.com/25511175/240148601-2420d77b-ba25-4718-9ccb-c5d0d95e3079.png) > > ### **For Other Tabs:** > ![image](https://user-images.githubusercontent.com/25511175/240148461-ce9636b3-fe11-4c46-a230-30d83eee5947.png) > ## Before ![image](https://github.com/go-gitea/gitea/assets/80308335/975ad038-07ca-4b10-b75d-ccf259be7b9d) ## After changes Project View <img width="1394" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/95d181d7-8e61-496d-9899-7b825c91ad56"> Packages View <img width="1378" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/7f5fd60f-6b18-4fa8-8c56-7b0d45d1a610"> ## Org view for projects page <img width="1385" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/6400dc89-a5ae-4f0a-831b-5b6efa020d89"> ## Org view for packages page <img width="1387" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/4e1e9ffe-1e4b-4334-8657-de11b5fd31d0"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: silverwind <me@silverwind.io>
* Check `ctx.Written()` for `GetActionIssue` (#25698)Jason Song2023-07-055-11/+20
| | | | | | | | | Fix #25697. Just avoid panic, maybe there's another bug to trigger this case. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix tags header and pretty format numbers (#25624)Lunny Xiao2023-07-051-0/+1
| | | This caused by #23465