Commit Graph

4490 Commits (ae282397be3e050383f5fc1ebdfa32a3006b987e)

Author SHA1 Message Date
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
Lunny Xiao 2653ac95e0
Extend comment treepath length (#35389)
Extend the maximum length of comment.treepath from 255 to 4000
characters.

All databases supported by Gitea allow VARCHAR fields of 4000, so
compatibility is ensured. Git itself does not impose a strict limit on
path length. On Windows, the `core.longpaths` setting has already been
enabled to handle long file paths.

Fix #33716

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-09-10 13:31:59 +00:00
Lunny Xiao e35e724e42
Use db.WithTx/WithTx2 instead of TxContext when possible (#35428) 2025-09-10 03:15:01 +00:00
koalajoe23 2802f96e97
check user and repo for redirects when using git via SSH transport (#35416)
fixes #30565 

When using git with a gitea hosted repository, the HTTP-Transport did
honor the user and repository redirects, which are created when renaming
a user or repo and also when transferring ownership of a repo to a
different organization. This is extremely helpful, as repo URLs remain
stable and do not have to be migrated on each client's worktree and
other places, e.g. CI at once.

The SSH transport - which I favor - did not know of these redirections
and I implemented a lookup during the `serv` command.
2025-09-09 20:13:41 +00:00
Lunny Xiao 58a368021f
adjust workflow page header 2025-09-04 10:51:40 -07:00
Lunny Xiao 990d8000fd
improvements 2025-09-04 10:01:53 -07:00
Lunny Xiao f681274e5d
enable/disable 2025-09-03 22:06:58 -07:00
Lunny Xiao af5ba854d9
improvements 2025-09-03 21:59:46 -07:00
Lunny Xiao 20b4ce5446
improvements 2025-09-03 16:24:42 -07:00
Lunny Xiao 6af504562b
new layout 2025-09-03 13:09:28 -07:00
Lunny Xiao 5481800fe8
some improvements 2025-09-02 21:42:47 -07:00
Lunny Xiao bf9511e63c Merge branch 'main' into lunny/project_workflow 2025-09-02 11:39:15 -07:00
Lunny Xiao 1717af72c4
Move some functions from package git to gitrepo (#33910)
Follow #33874
2025-09-01 19:13:18 +00:00
Lunny Xiao 4e1b8db1fc
Move HasWiki to repository service package (#33912)
Move HasWiki out of the models package to avoid referencing the absolute
wiki path directly.
2025-09-01 11:12:58 -07:00