19965 Commits

Author SHA1 Message Date
wxiaoguang
9a73a1fb83 Make "update file" API can create a new file when SHA is not set (#35738)
Fix #19008, use GitHub's behavior (empty SHA to create a new file)
2025-10-24 12:46:54 +08:00
Lunny Xiao
397d666432 Fix review request webhook bug (#35339) (#35723)
Frontport #35339
Fix #35327
2025-10-23 20:08:21 -07:00
silverwind
e03a68c48b Misc tool tweaks (#35734)
Some minor tooling tweaks:

- Ignore .venv in golangci-lint
- Move go tools to tools directory (e.g. everything that is not "build")
- Enable reportUnusedInlineConfigs in eslint, no current violations
- Apply modernize fix in code-batch-process, modernize cli did
apparently not catch it because of the `go:build ignore` tag.
2025-10-23 09:07:39 +00:00
silverwind
cab35ff17a Update dependencies (#35733)
- Update all JS, Python and Makefile dependencies
- Fixed two new go lint issues
- Tested the affected JS dependencies.
2025-10-23 08:35:48 +00:00
wxiaoguang
522c466e24 Make external iframe render work (#35730)
Fix #35729, #17635, #21098
2025-10-23 08:01:38 +00:00
silverwind
8085c75356 Remove mermaid margin workaround (#35732)
https://github.com/mermaid-js/mermaid/issues/4907 was fixed with mermaid
v11, so we no longer need to ship this workaround. The test case works
as expected:

<img width="244" height="58" alt="image"
src="https://github.com/user-attachments/assets/439616e9-4883-47fb-bf18-21ca86cb5da6"
/>
2025-10-23 06:43:52 +02:00
wxiaoguang
195fc715ff Fix external render (#35727)
Fix #35725

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-22 23:41:38 +00:00
ChristopherHX
08b9776970 Refactor Actions Token Access (#35688)
* use a single function to do Action Tokens Permission checks
* allows easier customization
* add basic tests
* lfs file locks should work now

---------

Signed-off-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-22 11:12:31 +00:00
Kemal Zebari
a9f2ea720b Honor delete branch on merge repo setting when using merge API (#35488)
Fix #35463.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-22 05:06:56 +00:00
wxiaoguang
5f0697243c Don't block site admin's operation if SECRET_KEY is lost (#35721)
Related: #24573
2025-10-22 12:35:56 +08:00
GiteaBot
c28aab6714 [skip ci] Updated translations via Crowdin 2025-10-22 00:36:55 +00:00
a1012112796
a4e23b81d3 fix attachment file size limit in server backend (#35519)
fix #35512

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-21 15:07:11 +00:00
wxiaoguang
3917d27467 Make restricted users can access public repositories (#35693)
Fix #35690

Change the "restricted user" behavior introduced by #6274. Now
restricted user can also access public repositories when sign-in is not
required.

For required sign-in, the behavior isn't changed.
2025-10-21 15:30:24 +08:00
wxiaoguang
a2eea2fb2e Fix various trivial problems (#35714) 2025-10-21 13:19:29 +08:00
wxiaoguang
b2ee5be52e Refactor legacy code (#35708)
And by the way, remove the legacy TODO, split large functions into small
ones, and add more tests
2025-10-20 11:43:08 -07:00
Zettat123
897e48dde3 Add quick approve button on PR page (#35678)
This PR adds a quick approve button on PR page to allow reviewers to
approve all pending checks. Only users with write permission to the 
Actions unit can approve.

---------

Signed-off-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-20 18:46:37 +08:00
wxiaoguang
66ee8f3553 Avoid emoji mismatch and allow to only enable chosen emojis (#35692)
Fix #23635
2025-10-19 13:06:45 -07:00
Bryan Mutai
c30d74d0f9 feat(diff): Enable commenting on expanded lines in PR diffs (#35662)
Fixes #32257 
/claim #32257

Implemented commenting on unchanged lines in Pull Request diffs, lines
are accessed by expanding the diff preview. Comments also appear in the
"Files Changed" tab on the unchanged lines where they were placed.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-19 18:19:12 +08:00
wxiaoguang
2d36a0c9ff Fix various bugs (#35684)
1. Fix incorrect column in `applySubscribedCondition`, add a test
2. Fix debian version parsing, add more tests fix #35695
3. Fix log level for HTTP errors, fix #35651
4. Fix abused "panic" handler in API `Migrate`
5. Fix the redirection from PR to issue, add a test
6. Fix Actions variable & secret name validation, add more tests
    * envNameCIRegexMatch is unnecessary, removed
    * validating in "delete" function doesn't make sense, removed
7. Fix incorrect link in release email

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2025-10-19 00:37:50 +08:00
ChristopherHX
322cb048e7 Fix workflow run event status while rerunning a failed job (#35689)
The event reported a completion status instead of requested, therefore
sent an email
2025-10-18 03:31:34 +00:00
Lunny Xiao
a7eceb57a9 Use gitrepo.Repository instead of wikipath (#35398)
Now the wikipath will not be referenced directly.
2025-10-17 20:00:44 -07:00
GiteaBot
ebd88af075 [skip ci] Updated translations via Crowdin 2025-10-17 00:34:59 +00:00
silverwind
5bf7cf788d Bump actions/labeler to v6 (#35681)
https://github.com/actions/labeler/releases/tag/v6.0.0
2025-10-16 19:00:41 +02:00
Surya Purohit
bf8ecf7c93 Use LFS object size instead of blob size when viewing a LFS file (#35679)
shows the main LFS filesize instead of the pointer filesize when viewing
a file

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-16 17:42:54 +08:00
dependabot[bot]
990201dc93 Bump happy-dom from 20.0.0 to 20.0.2 (#35677)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-15 19:07:40 -04:00
wxiaoguang
c55a017225 Fix missing Close when error occurs and abused connection pool (#35658)
Fix #35649

* Use upstream `git-lfs-transfer`
* The Close should be called when error occurs (bug fix)
* The connection pool should be shared (bug fix)
* Add more tests to cover "LFS over SSH download"
2025-10-15 09:47:12 +00:00
Lunny Xiao
1bdb0b71b1 Upgrade to go 1.25.3 (#35656) 2025-10-15 10:09:32 +02:00
wxiaoguang
9ae2e9e76f Always create Actions logs stepsContainer (#35654) 2025-10-15 04:07:58 +00:00
Lunny Xiao
16fc3323b9 Fix a bug missed return (#35655) 2025-10-14 20:12:07 -07:00
Lunny Xiao
731d803d19 Creating push comments before invoke pull request checking (#35647)
This PR moved the creation of pushing comments before pull request
mergeable checking. So that when the pull request status changed, the
comments should have been created.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-14 19:19:27 +00:00
silverwind
96102c69e7 Bump setup-go to v6 (#35660) 2025-10-14 14:28:05 -04:00
GiteaBot
22b92e30ca [skip ci] Updated translations via Crowdin 2025-10-13 00:37:21 +00:00
silverwind
49a0a11f55 Update JS deps, misc tweaks (#35643)
- Update all JS dependencies
- Enable eslint `no-useless-assignment` and fix 2 discovered issues
- Replace `gitea-vscode` svg with new `octicon-vscode`
- Remove now-unused `@ts-expect-error` comments
- Change Monaco wrapping behaviour to match the wrapping in code view:
no wrapping indent and break on any character.
2025-10-12 21:07:15 +00:00
silverwind
912515e63a Bump actions/checkout to v5 (#35644) 2025-10-12 18:01:42 +00:00
techknowlogick
f9a4b2753c nix flake update (#35639) 2025-10-12 15:59:00 +00:00
ChristopherHX
2401812b76 Cleanup ActionRun creation (#35624)
Closes #35622

---------

Signed-off-by: ChristopherHX <christopher.homberger@web.de>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-12 12:23:37 +00:00
techknowlogick
3d264ba636 bump archives&rar dep (#35637) 2025-10-12 05:48:19 +02:00
Lunny Xiao
662a44d924 Fix merge panic (#35606)
To prevent potential bugs, the logic in #35543 makes `gitcmd.Command`
panic when attempting to override stdout or stderr. Instead of using
`PrepareCmd`, this PR now uses the WithXXX methods directly to avoid the
panic.

Fix #35603
2025-10-12 04:24:00 +02:00
dependabot[bot]
24a595c3fc Bump happy-dom from 19.0.2 to 20.0.0 (#35625) 2025-10-12 01:52:03 +00:00
ChristopherHX
25c4eb1659 Refactor ActionRunJob parsing into a reusable function (#35623)
Use a helper method around the jobparser for parsing a single job
structure from an ActionRunJob

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-11 12:58:36 -07:00
鲁汀
b029ad431b Fix code tag style problem and LFS view bug (#35628)
Fix #35567

---------

Signed-off-by: 鲁汀 <131967983+lutinglt@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-12 02:38:42 +08:00
Zettat123
40f71bcd4c Support Actions concurrency syntax (#32751)
Fix #24769
Fix #32662
Fix #33260

Depends on https://gitea.com/gitea/act/pulls/124

-
https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency

## ⚠️ BREAKING ⚠️

This PR removes the auto-cancellation feature added by #25716. Users
need to manually add `concurrency` to workflows to control concurrent
workflows or jobs.

---------

Signed-off-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-10 18:58:55 +00:00
鲁汀
327d0a7fdd The status icon of the Action step is consistent with GitHub (#35618)
Before:
running:
<img width="45" height="34" alt="image"
src="https://github.com/user-attachments/assets/e2508f98-2f1f-4b7e-a80c-30b406f42531"
/>
waiting:
<img width="44" height="33" alt="image"
src="https://github.com/user-attachments/assets/e7c8164e-fdc3-4546-b088-31166544edb0"
/>

---
After:
running:
<img width="49" height="43" alt="image"
src="https://github.com/user-attachments/assets/b5a9b245-a995-458a-af23-d1723daa3692"
/>
waiting:
<img width="42" height="44" alt="image"
src="https://github.com/user-attachments/assets/ff72551e-cfb5-4665-af52-938ef0cf8f1c"
/>

`gitea-running.svg` is not an icon from the @ primer/octicon library,
extracted from the Github page. Github did not assign a clear class name
to this icon

---------

Signed-off-by: 鲁汀 <131967983+lutinglt@users.noreply.github.com>
Co-authored-by: lutinglt <lutinglt@users.noreply.github.com>
2025-10-10 11:25:03 -07:00
silverwind
165a3ead52 Mock external service in hcaptcha TestCaptcha (#35604)
The test calls out to a web service which may be down or unreachable as
seen in the linked issue. It's better for tests to not have such
external dependencies to make them absolutely stable.

Fixes: https://github.com/go-gitea/gitea/issues/35571
2025-10-10 06:21:45 +02:00
Lunny Xiao
9f664ab330 Fix inputing review comment will remove reviewer (#35591)
Fix #34617
2025-10-09 19:55:14 -07:00
GiteaBot
94d99c9c3c [skip ci] Updated translations via Crowdin 2025-10-10 00:34:09 +00:00
Surya Purohit
b8e5e2a93e Fix diffpatch API endpoint (#35610)
Fix the swagger documentation for the `diffpatch` API endpoint,
and fix the wrong API path caused by a refactoring change.

Closes #35602

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-10 00:39:14 +08:00
da Kai
0bc129481d Print PR-Title into tooltip for actions (#35579)
This PR updates the tooltip for Pull-Request triggered runs to show the
PR title instead of the PR number.

---
I dont remember PR numbers, so having the title in the tooltip makes it
much easier to recognize the right one 😊

Current
<img width="290" height="88" alt="Screenshot 2025-10-03 231547"
src="https://github.com/user-attachments/assets/dd8d264d-933f-4fb1-a945-82b172f95861"
/>

After
<img width="301" height="91" alt="Screenshot 2025-10-03 224628"
src="https://github.com/user-attachments/assets/74c9809a-c09a-4804-bb27-79058a99238b"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-09 10:01:47 +02:00
shashank-netapp
03fce8f3d0 Fixing issue #35530: Password Leak in Log Messages (#35584)
The Gitea codebase was logging `Elasticsearch` and `Meilisearch`
connection strings directly to log files without sanitizing them. Since
connection strings often contain credentials in the format
`protocol://username:password@host:port`, this resulted in passwords
being exposed in plain text in log output.

Fix:
- wrapped all instances of setting.Indexer.RepoConnStr and
setting.Indexer.IssueConnStr with the `util.SanitizeCredentialURLs()`
function before logging them.

Fixes: #35530

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-10-07 09:26:47 -07:00
Lunny Xiao
69f5ee970c Move some functions to gitrepo package (#35543)
Refactor Git command functions to use WithXXX methods instead of
exposing RunOpts.
This change simplifies reuse across gitrepo and improves consistency,
encapsulation, and maintainability of command options.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-07 17:06:51 +08:00