Commit Graph

4503 Commits (08d28090a4931e95b965eb39f7e0d9ecee68f28f)

Author SHA1 Message Date
Lunny Xiao 08d28090a4 Merge branch 'main' into lunny/project_workflow 2025-11-11 11:00:13 -08:00
wxiaoguang 050c9485df
Fix team member access check (#35899)
Fix #35499
2025-11-09 03:13:31 +00:00
Lunny Xiao bf841a831a Merge branch 'main' into lunny/project_workflow 2025-11-04 15:03:35 -08:00
silverwind 850012bf5c
Update golangci-lint to v2.6.0 (#35801)
https://github.com/golangci/golangci-lint/releases/tag/v2.6.0

- `modernize` linter is enabled, this is the same as `gopls modernize`
- ~~`perfsprint` linter is disabled because it conflicts with
`modernize` (maybe there is a middle ground)~~
- gocritic `deprecatedComment` is disabled as it conflicts with
`go-swagger`
2025-11-04 03:03:06 +00:00
Zettat123 bb1f52347a
Add a doctor command to fix inconsistent run status (#35840)
#35783 fixes an actions rerun bug. Due to this bug, some runs may be
incorrectly marked as `StatusWaiting` even though all the jobs are in
done status. These runs cannot be run or cancelled. This PR adds a new
doctor command to fix the inconsistent run status.

```
gitea doctor check --run fix-actions-unfinished-run-status --fix
```

Thanks to @ChristopherHX  for the test.
2025-11-04 03:32:26 +01:00
Lunny Xiao de26c8acce
Fix viewed files number is not right if not all files loaded (#35821)
Fix #35803

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
2025-11-03 13:34:52 -08:00
Lunny Xiao d9c0f86de8
Fix incorrect pull request counter (#35819)
Fix #35781, #27472

The PR will not correct the wrong numbers automatically. 

There is a cron task `check_repo_stats` which will be run when Gitea
start or midnight. It will correct the numbers.
2025-11-03 20:52:13 +00:00
Lunny Xiao 4c4a16ccb5 Merge branch 'main' into lunny/project_workflow 2025-10-31 21:32:51 -07:00
Mithilesh Gupta ef90befef1
Add test for ExtendCommentTreePathLength migration and fix bugs (#35791)
Co-authored-by: Mithilesh Gupta <guptamithilesh@protonmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-31 08:49:26 +08:00
Lunny Xiao df50690df7 Merge branch 'main' into lunny/project_workflow 2025-10-28 11:41:39 -07:00
Lunny Xiao e21fb903e3
Fix migration 2025-10-28 11:41:34 -07:00
Lunny Xiao 95b18eb781
Remove unnecessary code and fix comments (#35761)
Follow #35459, #32562

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-28 18:03:57 +00:00
Lunny Xiao 37196261a6
improvements 2025-10-25 16:46:18 -07:00
Lunny Xiao ae282397be
Fix lint and fix wrong migrations 2025-10-25 16:30:27 -07:00
Lunny Xiao 1bffdfe2fb Merge branch 'main' into lunny/project_workflow 2025-10-25 16:06:12 -07:00
Lunny Xiao 12feb0ee26
Add unit test and integration test 2025-10-25 16:03:53 -07:00
Zettat123 c9beb0b01f
Support actions and reusable workflows from private repos (#32562)
Resolve https://gitea.com/gitea/act_runner/issues/102

This PR allows administrators of a private repository to specify some
collaborative owners. The repositories of collaborative owners will be
allowed to access this repository's actions and workflows.

Settings for private repos:


![image](https://github.com/user-attachments/assets/e591c877-f94d-48fb-82f3-3b051f21557e)

---

This PR also moves "Enable Actions" setting to `Actions > General` page

<img width="960" alt="image"
src="https://github.com/user-attachments/assets/49337ec2-afb1-4a67-8516-5c9ef0ce05d4"
/>

<img width="960" alt="image"
src="https://github.com/user-attachments/assets/f58ee6d5-17f9-4180-8760-a78e859f1c37"
/>

---------

Signed-off-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2025-10-25 17:37:33 +00:00
Lunny Xiao 5454fdacd4
Use git model to detect whether branch exist instead of gitrepo method (#35459) 2025-10-25 10:08:25 -07:00
Lunny Xiao 635649d3bd
add translations 2025-10-24 23:59:13 -07:00
Lunny Xiao 3d081b300f
Fix bug 2025-10-24 21:35:11 -07:00
Lunny Xiao 323a24e12c
Fix bug 2025-10-24 18:37:19 -07:00
Zettat123 0d740a6a72
Improve online runner check (#35722)
This PR moves "no online runner" warning to the runs list. 

A job's `runs-on` may contain expressions like `runs-on: [self-hosted,
"${{ inputs.chosen-os }}"]` so the value of `runs-on` may be different
in each run. We cannot check it through the workflow file.

<details>
  <summary>Screenshots</summary>

Before:

<img width="960" alt="3d2a91746271d8b1f12c8f7d20eba550"
src="https://github.com/user-attachments/assets/7a972c50-db97-49d2-b12b-c1a439732a11"
/>

After:

<img width="960" alt="image"
src="https://github.com/user-attachments/assets/fc076e0e-bd08-4afe-99b9-c0eb0fd2c7e7"
/>
</details>

This PR also splits `prepareWorkflowDispatchTemplate` function into 2
functions:
- `prepareWorkflowTemplate` get and check all of the workflows
- `prepareWorkflowDispatchTemplate` only prepare workflow dispatch
config for `workflow_dispatch` workflows.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-24 12:02:52 -07:00
Lunny Xiao 903d605fe1
improvements 2025-10-24 10:55:10 -07:00
Lunny Xiao c2419f8c5b
improvements 2025-10-23 22:24:52 -07:00
Lunny Xiao 822387aa38
support labels filter 2025-10-23 11:06:44 -07:00
Lunny Xiao 74fc30ff71
Support add labels and remove labels for issue's project column changed event 2025-10-23 00:47:34 -07:00
Lunny Xiao b191ded690
Fix 2025-10-22 22:40:49 -07:00
Lunny Xiao f7b8f6ed99 Merge branch 'main' into lunny/project_workflow 2025-10-22 10:04:51 -07: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
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 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 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
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
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
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
Lunny Xiao 9f664ab330
Fix inputing review comment will remove reviewer (#35591)
Fix #34617
2025-10-09 19:55:14 -07: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
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
Lunny Xiao ad2ff67343
Move archive function to repo_model and gitrepo (#35514) 2025-10-06 15:01:26 -07:00
Lunny Xiao 17c8aa6587
Add rebase push display wrong comments bug (#35560)
Fix #35518

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-10-03 15:16:17 -07:00
wxiaoguang 71360a94cb
Address some CodeQL security concerns (#35572)
Although there is no real security problem
2025-10-04 01:21:26 +08:00
Lunny Xiao 7bf2972379
Move GetDiverging functions to gitrepo (#35524)
Extracted from #35469

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-26 15:15:42 +00:00
Bjarne Koll 2f3da6d6b3
Correctly override user unitmodes (#35501)
Commit 6a97ab0af4 reworked team permission
application. The introduced logic overrode the unitModes for *every*
team a user is in, max(...) the current value and the team value
together.

The logic completely fails in case the team does not have a unit for the
specific unit type defined, in which case the logic inserted the
minimumVisibility, overriding any previous aggregation of access modes
for the unit.

This is resolved by simply always merging the unit access mode of the
team as it will simply default to None in case the team does not have a
permission defined for the unit, which will be swallowed by the max(..)
call in favour of the previous aggregated permission.
2025-09-17 12:26:58 -07:00
Lunny Xiao 9332ff291b
Move git command to git/gitcmd (#35483)
The name cmd is already used in many places and may cause conflicts, so
I chose `gitcmd` instead to minimize potential naming conflicts.
2025-09-15 23:33:12 -07:00
wxiaoguang 4fe1066a17
Replace gobwas/glob package (#35478)
https://github.com/gobwas/glob is unmaintained and has bugs.
2025-09-13 18:01:00 +00:00
luzpaz 688abac5ca
Fix various typos in codebase (#35480) 2025-09-13 10:34:43 -04:00
ChristopherHX 84812e42df
Fix SSH signing key path will be displayed in the pull request UI (#35381)
Closes #35361

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-09-12 03:00:18 +00:00