]> source.dussan.org Git - gitea.git/log
gitea.git
18 months agoFix broken clone script on an empty archived repo (#24339) (#24348)
Giteabot [Wed, 26 Apr 2023 08:13:16 +0000 (04:13 -0400)]
Fix broken clone script on an empty archived repo (#24339) (#24348)

Backport #24339 by @yardenshoham

I made it render the script even if the repo is archived

- Fixes #24324

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
18 months agoDon't set meta `theme-color` by default (#24340) (#24346)
Giteabot [Wed, 26 Apr 2023 05:33:15 +0000 (01:33 -0400)]
Don't set meta `theme-color` by default (#24340) (#24346)

Backport #24340 by @silverwind

Fixes https://github.com/go-gitea/gitea/issues/24321. By not setting
this meta tag, Safari will use body color for chrome and out-of-viewport
areas, which looks much better then static mismatching green.

As per
[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color)
it's really only Apple browsers who still support this tag, most others
have dropped support.

Before:
<img width="347" alt="Screenshot 2023-04-25 at 19 59 13"
src="https://user-images.githubusercontent.com/115237/234363180-0fe667ef-5469-4f5f-b31a-c9d73aff10ac.png">

After:
<img width="361" alt="Screenshot 2023-04-25 at 20 00 00"
src="https://user-images.githubusercontent.com/115237/234363185-e2d2b62f-0133-4316-944d-b614ffb84eb0.png">

Co-authored-by: silverwind <me@silverwind.io>
18 months agoAdd --font-weight-bold and set previous bold to 601 (#24307) (#24331)
wxiaoguang [Tue, 25 Apr 2023 23:51:54 +0000 (07:51 +0800)]
Add --font-weight-bold and set previous bold to 601 (#24307) (#24331)

Backport #24307

Fix #24305

According to MDN, "bold" starts from 700, some fonts do not provide
"bolding" for weight 600

Manually backport, no CSS conflict.

18 months agoRespect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035) (...
Giteabot [Tue, 25 Apr 2023 19:25:08 +0000 (15:25 -0400)]
Respect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035) (#24333)

Backport #24035 by @garymoon

This change prevents Gitea from bypassing the manual approval process
for newly registered users when OIDC is used.

- Resolves https://github.com/go-gitea/gitea/issues/23392

Signed-off-by: Gary Moon <gary@garymoon.net>
Co-authored-by: Gary Moon <garymoon@users.noreply.github.com>
18 months agoWrap too long push mirror addresses (#21120) (#24334)
Giteabot [Tue, 25 Apr 2023 16:47:26 +0000 (12:47 -0400)]
Wrap too long push mirror addresses (#21120) (#24334)

Backport #21120 by @JakobDev

I noticed that it is possible to break the push mirror list by entering
a too long URL. This should fix it.

| Before         | After     |
|--------------|-----------|

|![Before](https://user-images.githubusercontent.com/15185051/189294585-333965d1-0f0f-48e2-96d5-e04b84b55ae3.png)|![After](https://user-images.githubusercontent.com/15185051/189294619-301e271c-b89b-4bc0-9c11-9536bd0302be.png)|

Co-authored-by: JakobDev <jakobdev@gmx.de>
18 months agoFix typo in API route (#24310) (#24332)
Giteabot [Tue, 25 Apr 2023 14:57:33 +0000 (10:57 -0400)]
Fix typo in API route (#24310) (#24332)

Backport #24310 by @silverwind

Continuation of https://github.com/go-gitea/gitea/pull/23995

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: bilogic <946010+bilogic@users.noreply.github.com>
19 months agoRemove org users who belong to no teams (#24247) (#24313)
Giteabot [Tue, 25 Apr 2023 02:50:32 +0000 (22:50 -0400)]
Remove org users who belong to no teams (#24247) (#24313)

Backport #24247 by @yp05327

Fix #24128

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
19 months agoUnify nightly naming across binaries and docker images (#24116) (#24308)
Giteabot [Mon, 24 Apr 2023 16:23:01 +0000 (12:23 -0400)]
Unify nightly naming across binaries and docker images (#24116) (#24308)

Backport #24116 by @techknowlogick

Proposal found here: https://github.com/go-gitea/gitea/issues/23654

TODO: make non-breaking (can we publish docker image using dev and
nightly prefix? at same time). if anyone has advice please comment :)

If this PR is merged, then I can add redirects to the downloads site.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoUpgrade act (#24298) (#24300)
Giteabot [Mon, 24 Apr 2023 08:18:47 +0000 (04:18 -0400)]
Upgrade act  (#24298) (#24300)

Backport #24298 by @Zettat123

Upgrade act to version `v0.243.4`

- Support `configuration variables`
([#43](https://gitea.com/gitea/act/pulls/43))
- Support specifying command for `services` containers
([#50](https://gitea.com/gitea/act/pulls/50))

Co-authored-by: Zettat123 <zettat123@gmail.com>
19 months agoFix bug when deleting wiki with no code write permission (#24274) (#24295)
Giteabot [Mon, 24 Apr 2023 00:20:45 +0000 (20:20 -0400)]
Fix bug when deleting wiki with no code write permission (#24274) (#24295)

Backport #24274 by @lunny

Fix #24125

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
19 months agoHandle canceled workflow as a warning instead of a fail (#24282) (#24292)
Giteabot [Sun, 23 Apr 2023 19:44:45 +0000 (15:44 -0400)]
Handle canceled workflow as a warning instead of a fail (#24282) (#24292)

Backport #24282 by @wolfogre

Follow what Drone CI does:

![image](https://user-images.githubusercontent.com/9418365/233829853-d1c30a30-10cc-4b97-a134-793a79d46d85.png)

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoLoad reviewer for comments when dismissing a review (#24281) (#24288)
Giteabot [Sun, 23 Apr 2023 16:44:57 +0000 (12:44 -0400)]
Load reviewer for comments when dismissing a review (#24281) (#24288)

19 months agoOnly delete secrets belonging to its owner (#24284) (#24286)
Giteabot [Sun, 23 Apr 2023 14:36:20 +0000 (10:36 -0400)]
Only delete secrets belonging to its owner (#24284) (#24286)

Backport #24284 by @KN4CK3R

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agofix calReleaseNumCommitsBehind (#24148) (#24197)
oliverpool [Sat, 22 Apr 2023 16:30:24 +0000 (18:30 +0200)]
fix calReleaseNumCommitsBehind (#24148) (#24197)

Backport #24148

`repoCtx.CommitsCount` is not reliably the commit count of the default
branch (Repository.GetCommitsCount depends on what is currently
displayed).

_contributed in the context of @forgejo_

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix footer display (#24251) (#24269)
wxiaoguang [Sat, 22 Apr 2023 08:21:56 +0000 (16:21 +0800)]
Fix footer display (#24251) (#24269)

Backport #24251

Fix #24249

Diff with ignoring spaces:
https://github.com/go-gitea/gitea/pull/24269/files?diff=split&w=1

Manually tested

![image](https://user-images.githubusercontent.com/2114189/233766806-18eb18ad-0c4d-44f7-b0fc-b40466c64445.png)

Co-authored-by: Lauris BH <lauris@nix.lv>
19 months agoFix owner team access mode value in team_unit table (#24224)
yp05327 [Sat, 22 Apr 2023 06:53:03 +0000 (15:53 +0900)]
Fix owner team access mode value in team_unit table (#24224)

Partly backport #23675

Co-authored-by: Giteabot <teabot@gitea.io>
19 months agoFix access token issue on some public endpoints (#24194) (#24259)
Giteabot [Fri, 21 Apr 2023 18:59:17 +0000 (14:59 -0400)]
Fix access token issue on some public endpoints (#24194) (#24259)

Backport #24194 by @harryzcy

- [x] Identify endpoints that should be public
- [x] Update integration tests

Fix #24159

Co-authored-by: harryzcy <harry@harryzheng.com>
19 months agoShow commit history for closed/merged PRs (#24238) (#24261)
Giteabot [Fri, 21 Apr 2023 18:15:00 +0000 (14:15 -0400)]
Show commit history for closed/merged PRs (#24238) (#24261)

Backport #24238 by @wxiaoguang

Close #24237

Before:

<details>

![image](https://user-images.githubusercontent.com/2114189/233424875-a69c6dad-df4a-483e-b796-36c6459af2d6.png)

</details>

After:

![image](https://user-images.githubusercontent.com/2114189/233424712-60a296de-017b-49a8-89b2-5925ff452646.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoFix label color, fix divider in dropdown (#24215) (#24244)
Giteabot [Fri, 21 Apr 2023 03:28:55 +0000 (23:28 -0400)]
Fix label color, fix divider in dropdown (#24215) (#24244)

Backport #24215 by @silverwind

Two small CSS fixes:

1. Fix basic primary label hover:

Before:
<img width="172" alt="Screenshot 2023-04-19 at 20 00 32"
src="https://user-images.githubusercontent.com/115237/233161903-eec2de54-1a58-44ac-a6ef-2d77157317f6.png">

After:
<img width="179" alt="Screenshot 2023-04-19 at 20 05 29"
src="https://user-images.githubusercontent.com/115237/233162028-995404ac-5852-4d03-821f-6eb4a918a9e3.png">

2. Fix border color of divider in dropdown and remove margin so it looks
better with hover effect, as discussed in
https://github.com/go-gitea/gitea/pull/24143:

<img width="205" alt="Screenshot 2023-04-19 at 20 03 24"
src="https://user-images.githubusercontent.com/115237/233162102-3f4a4142-9634-4c95-acf0-be57072ce7eb.png">
<img width="311" alt="Screenshot 2023-04-19 at 20 03 55"
src="https://user-images.githubusercontent.com/115237/233162109-faa616f6-02e4-43d3-95fa-66787a7f914c.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix issue attachment handling (#24202) (#24221)
wxiaoguang [Thu, 20 Apr 2023 08:21:10 +0000 (16:21 +0800)]
Fix issue attachment handling (#24202) (#24221)

Backport #24202

Close #24195

Fix the bug:

1. The old code doesn't handle `removedfile` event correctly
2. The old code doesn't provide attachments for type=CommentTypeReview

---------

Co-authored-by: silverwind <me@silverwind.io>
19 months agoAdd run status in action view page (#24223)
yp05327 [Thu, 20 Apr 2023 07:24:50 +0000 (16:24 +0900)]
Add run status in action view page (#24223)

Backport #23212

19 months agoVertical widths of containers removed (#24184) (#24211)
Giteabot [Thu, 20 Apr 2023 01:02:38 +0000 (21:02 -0400)]
Vertical widths of containers removed (#24184) (#24211)

Backport #24184 by @krzysztofjeziorny

A vertical overflow appears in Firefox 112/MacOS 12.6 when the system
setting for scrollbars is to "Always" show them.

Here, the fixed 100vw container widths are removed, which removes the
overflow. It is, however, only simulated in Developer Tools in latest
Firefox and Chromium, so please test on a Gitea installation.

Co-authored-by: Krzysztof Jeziorny <872730+krzysztofjeziorny@users.noreply.github.com>
19 months agoDon't list root repository on compare page if pulls not allowed (#24183) (#24210)
Giteabot [Wed, 19 Apr 2023 23:07:47 +0000 (19:07 -0400)]
Don't list root repository on compare page if pulls not allowed (#24183) (#24210)

Backport #24183 by @lunny

Fix #24165

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix template error in pull request with deleted head repo (#24192) (#24216)
Giteabot [Wed, 19 Apr 2023 21:20:19 +0000 (17:20 -0400)]
Fix template error in pull request with deleted head repo (#24192) (#24216)

Backport #24192 by @brechtvl

Rendering of Allow Edits from Maintainers did not check if the head repo
exists, while other parts of the page handle it gracefully.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
19 months agoFix incorrect CORS default values (#24206) (#24217)
Giteabot [Wed, 19 Apr 2023 20:23:25 +0000 (16:23 -0400)]
Fix incorrect CORS default values (#24206) (#24217)

Backport #24206 by @wxiaoguang

Document:

```
;ALLOW_DOMAIN = *
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
```

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoUse correct locale key for forks page (#24172) (#24175)
Giteabot [Mon, 17 Apr 2023 21:21:53 +0000 (17:21 -0400)]
Use correct locale key for forks page (#24172) (#24175)

Backport #24172 by @jolheiser

https://github.com/go-gitea/gitea/blob/4014200021a1997283c779a815fe9e5febf1fda1/options/locale/locale_en-US.ini#L873

https://github.com/go-gitea/gitea/blob/4014200021a1997283c779a815fe9e5febf1fda1/options/locale/locale_en-US.ini#L943

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoFix Org edit page bugs: renaming detection, maxlength (#24161) (#24171)
Giteabot [Mon, 17 Apr 2023 16:20:47 +0000 (12:20 -0400)]
Fix Org edit page bugs: renaming detection, maxlength (#24161) (#24171)

Backport #24161 by @wxiaoguang

## Before

* The renaming detection is wrong (eg: pasting a new name into the input
doesn't trigger the detection)
* The renaming prompt layout is not good
* Some MaxSize/maxlength rules is missing

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoSupport converting varchar to nvarchar for mssql database (#24105) (#24168)
Giteabot [Mon, 17 Apr 2023 14:10:15 +0000 (10:10 -0400)]
Support converting varchar to nvarchar for mssql database (#24105) (#24168)

Backport #24105 by @lunny

In #12269, all string fields of struct will generate a NVARCHAR column
in database, but for those Gitea instances installed before that PR,
users have to convert columns themselves.

In this PR, we update the `./gitea admin convert` commands to support
both MySQL and MSSQL database converting. Previously, it only supported
converting `utf8 -> utf8mb4` for MySQL.
Now, it will check the database types.
If it's MSSQL, it will convert `VARCHAR -> NVARCHAR` as well.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoUse 1.18's aria role for dropdown menus (#24144) (#24155)
wxiaoguang [Mon, 17 Apr 2023 11:02:09 +0000 (19:02 +0800)]
Use 1.18's aria role for dropdown menus (#24144) (#24155)

Backport #24144

Co-authored-by: silverwind <me@silverwind.io>
19 months agoUpdate redis library to support redis v7 (#24114) (#24156)
Patrick Schratz [Mon, 17 Apr 2023 06:34:59 +0000 (08:34 +0200)]
Update redis library to support redis v7 (#24114) (#24156)

backports #24114

---------

Co-authored-by: techknowlogick <hello@techknowlogick.com>
19 months agoSort repo topic labels by name (#24123) (#24153)
wxiaoguang [Mon, 17 Apr 2023 01:00:19 +0000 (09:00 +0800)]
Sort repo topic labels by name (#24123) (#24153)

Backport #24123
Close #24077

Manually backported and tested.

<img width="330" alt="image"
src="https://user-images.githubusercontent.com/2114189/232283645-92cc85dd-ba16-44a9-a7ef-5712b9d285e9.png">

19 months agoSet EasyMDE heading font-size to the same size as the resulting markdown (#24151...
wxiaoguang [Sun, 16 Apr 2023 21:34:19 +0000 (05:34 +0800)]
Set EasyMDE heading font-size to the same size as the resulting markdown (#24151) (#24152)

Backport #24151

Fix #23816

<img width="519" alt="image"
src="https://user-images.githubusercontent.com/2114189/232283304-21f56e82-d80e-4199-9b14-74699d80cd20.png">

19 months agoFix 2-dot direct compare to use the right base commit (#24133) (#24150)
Giteabot [Sun, 16 Apr 2023 11:17:13 +0000 (07:17 -0400)]
Fix 2-dot direct compare to use the right base commit (#24133) (#24150)

Backport #24133 by @jtran

For 2-dot direct compare, we should use the base commit in the title and
templates, as is used elsewhere, not the common ancestor which is used
for 3-dot compare. I believe that this change should have been included
in #22949.

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
19 months agoHighlight selected file in the PR file tree (#23947) (#24126)
sillyguodong [Fri, 14 Apr 2023 09:54:22 +0000 (17:54 +0800)]
Highlight selected file in the PR file tree (#23947) (#24126)

backport #23947 by @yusifeng

before

![before](https://user-images.githubusercontent.com/36984894/230327904-6e712ca2-f777-4cad-99f3-53bc20008180.gif)

after

![after](https://user-images.githubusercontent.com/36984894/230327966-6e5dd971-f0df-427a-a80b-6a9b6db6065d.gif)

Co-authored-by: yusifeng <36984894+yusifeng@users.noreply.github.com>
19 months agoFix incorrect server error content in RunnersList (#24118) (#24121)
Giteabot [Fri, 14 Apr 2023 04:52:21 +0000 (00:52 -0400)]
Fix incorrect server error content in RunnersList (#24118) (#24121)

Backport #24118 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoFix mismatch between hook events and github event types (#24048) (#24091)
Zettat123 [Thu, 13 Apr 2023 07:19:41 +0000 (15:19 +0800)]
Fix mismatch between hook events and github event types (#24048) (#24091)

Backport https://github.com/go-gitea/gitea/pull/24048

Some workflow trigger events can have multiple activity types, such as
`issues` and `pull_request`, and user can specify which types can
trigger the workflow. See GitHub documentation:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows

Now some hook events cannot match the workflow trigger events correctly
because we don't check the activity types. For example,
`pull_request_label` is an individual hook event. But there isn't a
`pull_request_label` workflow trigger event, we can only use
`pull_request` event's `label` activity type. If we don't check the
activity types, the workflows without the `label` activity type may be
triggered by the `pull_request_label` event by mistake. We need to
improve the match logic.

- [x] [`issues`
](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues)
- [x]
[`issue_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment)
- [x]
[`pull_request`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
- [x]
[`pull_request_review`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review)
- [x]
[`pull_request_review_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review_comment)
- [x]
[`release`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
- [x]
[`registry_package`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#registry_package)

19 months agoChangelog v1.19.1 (#24079) v1.19.1
6543 [Thu, 13 Apr 2023 01:38:06 +0000 (03:38 +0200)]
Changelog v1.19.1 (#24079)

19 months agoBackport locales to 1.19 (#24083)
wxiaoguang [Wed, 12 Apr 2023 21:07:43 +0000 (05:07 +0800)]
Backport locales to 1.19 (#24083)

Backport locales

Generated by `go run build/backport-locales.go release/v1.19`

19 months agoImprove LFS error logs (#24072) (#24082)
Giteabot [Wed, 12 Apr 2023 20:23:57 +0000 (16:23 -0400)]
Improve LFS error logs (#24072) (#24082)

Backport #24072 by @wxiaoguang

The error logs were not clear.

Help (but not fix) #24053

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoUpdate the value of the `diffEnd` when click `Show More` btn in the DiffFileTree...
Giteabot [Wed, 12 Apr 2023 19:27:53 +0000 (15:27 -0400)]
Update the value of the `diffEnd` when click `Show More` btn in the DiffFileTree (#24069) (#24078)

Backport #24069 by @sillyguodong

In the component `DiffFileTree`,if don't update the value of the
`diffEnd` in the callback of ajax request, click `Show More` btn will
always return the same response, duplicate files are appended to the
file list.

Before:

https://user-images.githubusercontent.com/33891828/231371188-82d169af-10bb-47e2-8aca-83ced2597f2d.mov

After:

https://user-images.githubusercontent.com/33891828/231369805-39a5a4d0-662c-4f08-bc5a-7d31e8782453.mov

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
19 months agoFix custom mailer template on Windows (#24081)
wxiaoguang [Wed, 12 Apr 2023 16:16:40 +0000 (00:16 +0800)]
Fix custom mailer template on Windows (#24081)

Fix #24075
Fix #23873

From the log:

```
2023/04/02 19:41:46 .../templates/mailer.go:68:1() [T] Adding mailer template for \issue\default from "C:\gitea\custom\templates\mail\issue\default.tmpl"
```

That `assetName ` on Windows is wrong. Gitea only uses slash `/`.

19 months agoMake label templates have consistent behavior and priority (#23749) (#24071)
wxiaoguang [Wed, 12 Apr 2023 14:05:10 +0000 (22:05 +0800)]
Make label templates have consistent behavior and priority (#23749) (#24071)

Backport #23749

Fix https://github.com/go-gitea/gitea/issues/23715

Backported manually and tested manually.

19 months agoAdd cardtype to org/user level project on creation, edit and view (#24043) (#24066)
Hester Gong [Wed, 12 Apr 2023 12:23:05 +0000 (20:23 +0800)]
Add cardtype to org/user level project on creation, edit and view (#24043) (#24066)

Backport #24043

Part of #23318

The way to fix the missing cardtype for user/org level projects in this
PR is to port the cardtype related part from #22112 to org/user level
projects' template and router functions.

Before:
<img width="1135" alt="截屏2023-04-11 13 55 49"
src="https://user-images.githubusercontent.com/17645053/231069068-ba897129-ae90-4aa0-9b0f-468bf5c65375.png">

<img width="1131" alt="截屏2023-04-11 13 55 59"
src="https://user-images.githubusercontent.com/17645053/231069084-279f6681-5a10-42da-b5a8-2b0ba47c7078.png">

After:
Create
<img width="835" alt="截屏2023-04-11 13 27 16"
src="https://user-images.githubusercontent.com/17645053/231064445-0d6e12bd-5725-48db-a102-80e7472757c2.png">

Edit
<img width="852" alt="截屏2023-04-11 13 27 05"
src="https://user-images.githubusercontent.com/17645053/231064503-c70525cd-1038-43ec-8d93-8b8d95d183d4.png">

View
<img width="1329" alt="截屏2023-04-11 13 26 56"
src="https://user-images.githubusercontent.com/17645053/231064529-26023c85-698b-4b2e-af02-45f9820c77ec.png">

---------

Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix accidental overwriting of LDAP team memberships (#24050) (#24065)
Giteabot [Wed, 12 Apr 2023 11:22:02 +0000 (07:22 -0400)]
Fix accidental overwriting of LDAP team memberships (#24050) (#24065)

Backport #24050 by @sillyguodong

In the `for` loop, the value of `membershipsToAdd[org]` and
`membershipsToRemove[org]` is a slice that should be appended instead of
overwritten.
Due to the current overwrite, the LDAP group sync only matches the last
group at the moment.

## Example reproduction
- an LDAP user is both a member of
`cn=admin_staff,ou=people,dc=planetexpress,dc=com` and
`cn=ship_crew,ou=people,dc=planetexpress,dc=com`.
- configuration of `Map LDAP groups to Organization teams ` in
`Authentication Sources`:
```json
{
    "cn=admin_staff,ou=people,dc=planetexpress,dc=com":{
        "test_organization":[
            "admin_staff",
            "test_add"
        ]
    },
    "cn=ship_crew,ou=people,dc=planetexpress,dc=com":{
        "test_organization":[
            "ship_crew"
        ]
}
```
- start `Synchronize external user data` task in the `Dashboard`.
- the user was only added for the team `test_organization.ship_crew`

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
19 months ago Refactor commit status for Actions jobs (#23786) (#24060)
Denys Konovalov [Wed, 12 Apr 2023 02:37:34 +0000 (04:37 +0200)]
 Refactor commit status for Actions jobs (#23786)  (#24060)

Backport #23786

Refactor commit status for Actions jobs (#23786)

Highlights:
- Treat `StatusSkipped` as `CommitStatusSuccess` instead of
`CommitStatusFailure`, so it fixed #23599.
- Use the bot user `gitea-actions` instead of the trigger as the creator
of commit status.
- New format `<run_name> / <job_name> / (<event>)` for the context of
commit status to avoid conflicts.
- Add descriptions for commit status.
- Add the missing calls to `CreateCommitStatus`.
- Refactor `CreateCommitStatus` to make it easier to use.

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoFix branch protection priority (#24045) (#24061)
Giteabot [Tue, 11 Apr 2023 19:07:38 +0000 (15:07 -0400)]
Fix branch protection priority (#24045) (#24061)

Backport #24045 by @lunny

Fix #24044

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoUpdate documentation to explain which projects allow Gitea to host static pages ...
Giteabot [Tue, 11 Apr 2023 16:43:35 +0000 (12:43 -0400)]
Update documentation to explain which projects allow Gitea to host static pages (#23993) (#24058)

Backport #23993 by @6543

close  #23521

Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoUse actions job link as commit status URL instead of run link (#24023) (#24032)
Jason Song [Mon, 10 Apr 2023 13:46:36 +0000 (21:46 +0800)]
Use actions job link as commit status URL instead of run link (#24023) (#24032)

Backport #24023.

A commit status is bound to a job, not a run.

19 months agoAdd actions support to package auth verification (#23729) (#24028)
Giteabot [Mon, 10 Apr 2023 08:36:21 +0000 (04:36 -0400)]
Add actions support to package auth verification (#23729) (#24028)

Backport #23729 by @yp05327

Partly fixes https://github.com/go-gitea/gitea/issues/23642

Error info:

![image](https://user-images.githubusercontent.com/18380374/227827027-4280a368-ec9e-49e0-bb93-6b496ada7cd9.png)
ActionsUser (userID -2) is used to login in to docker in action jobs.

Due to we have no permission policy settings of ActionsUser now,
ActionsUser can only access public registry by this quick fix.

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoFix protected branch for API (#24013) (#24027)
Giteabot [Mon, 10 Apr 2023 06:48:02 +0000 (02:48 -0400)]
Fix protected branch for API (#24013) (#24027)

Backport #24013 by @lunny

Fix #23998

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoShow errors for KaTeX and mermaid on the preview tab (#24009) (#24019)
Giteabot [Sun, 9 Apr 2023 12:48:28 +0000 (08:48 -0400)]
Show errors for KaTeX and mermaid on the preview tab (#24009) (#24019)

Backport #24009 by @silverwind

There is a conflicting fomantic rule that hid the error messages inside
the markdown preview tab for things like mermaid or katex. Overruled it
to always show these errors.

<img width="774" alt="image"
src="https://user-images.githubusercontent.com/115237/230738528-322814c1-8994-495e-b901-bbb79b924ccb.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoShow protected branch rule names again (#23907) (#24018)
Giteabot [Sun, 9 Apr 2023 12:06:16 +0000 (08:06 -0400)]
Show protected branch rule names again (#23907) (#24018)

Backport #23907 by @HesterG

`!important`s for one of the primary label selectors are removed by
#23774, so the repository branch protection settings ui will not have
the demanding css. This PR modifies `.ui.primary.label` to fix it.

Before:
<img width="1408" alt="飞书20230404-115410"
src="https://user-images.githubusercontent.com/17645053/229683221-ef9c7d5c-68a8-42b0-ba19-ef2d5dfce5f9.png">

After:
<img width="1419" alt="截屏2023-04-04 11 56 32"
src="https://user-images.githubusercontent.com/17645053/229683469-70cfc92d-d7ef-4323-a7f5-2247810fabce.png">

Co-authored-by: Hester Gong <hestergong@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agofix: do not escape space between PyPI repository url and package name… (#23981) ...
Giteabot [Sat, 8 Apr 2023 21:13:43 +0000 (17:13 -0400)]
fix: do not escape space between PyPI repository url and package name… (#23981) (#24008)

Backport #23981 by @Gunzinger

…; add trailing slash to PyPI repository URL (in accordance to PEP-503)

This should solve Issue #23980, by moving the space in front of the
package name and the package name out of the `gitea-origin-url` block.
It also adds a trailing slash to the PyPI repository URL in accordance
to [Python PEP-503](https://peps.python.org/pep-0503/).

Co-authored-by: Daniel Gunzinger <daniel.gunzinger@gmail.com>
19 months agoAdjust sticky pr header to cover background (#23956) (#23999)
Giteabot [Sat, 8 Apr 2023 16:36:11 +0000 (12:36 -0400)]
Adjust sticky pr header to cover background (#23956) (#23999)

Backport #23956 by @silverwind

Very minor CSS tweak: Adjust sticky PR header to cover the box-shadow of
selected files.

Before:
<img width="1250" alt="Screenshot 2023-04-06 at 22 54 59"
src="https://user-images.githubusercontent.com/115237/230492218-4d71da48-a362-4c52-a7f7-01daf4ffa458.png">

After:
<img width="1255" alt="Screenshot 2023-04-06 at 22 54 46"
src="https://user-images.githubusercontent.com/115237/230492227-c7142210-e535-4da8-b610-37d33dcbb549.png">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoSet `ref` to fully-formed of the tag when trigger event is `release` (#23944) (#23989)
Giteabot [Sat, 8 Apr 2023 12:43:46 +0000 (08:43 -0400)]
Set `ref` to fully-formed of the tag when trigger event is `release` (#23944) (#23989)

Backport #23944 by @sillyguodong

Fix #23943
When trigger event is `release`, ref should be like
`refs/tags/<tag_name>` instead of `CommitID`

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
19 months agoFix redirect bug when creating issue from a project (#23971) (#23997)
Giteabot [Sat, 8 Apr 2023 10:38:56 +0000 (06:38 -0400)]
Fix redirect bug when creating issue from a project (#23971) (#23997)

Backport #23971 by @lunny

Fix #23966

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoRemove `Repository.getFilesChanged` to fix Actions `paths` and `paths-ignore` filter...
Giteabot [Sat, 8 Apr 2023 08:16:21 +0000 (04:16 -0400)]
Remove `Repository.getFilesChanged` to fix Actions `paths` and `paths-ignore` filter (#23920) (#23969)

Backport #23920 by @ChristopherHX

Remove the misbehaving function and call
Repository.GetFilesChangedBetween instead.

Fixes #23919

---

~~_TODO_ test this~~ `Repository.getFilesChanged` seems to be only used
by Gitea Actions, but a similar function already exists

**Update** I tested this change and the issue is gone.

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
19 months agoDiscolor pull request tab labels (#23950) (#23987)
Giteabot [Sat, 8 Apr 2023 02:32:42 +0000 (22:32 -0400)]
Discolor pull request tab labels (#23950) (#23987)

Backport #23950 by @silverwind

https://github.com/go-gitea/gitea/pull/22687 has discolored the repo tab
labels. This does the same for PR tabs for consistency. Value `0` is
still rendered like before.

Before:
<img width="502" alt="Screenshot 2023-04-06 at 19 35 24"
src="https://user-images.githubusercontent.com/115237/230454329-db6244ff-7d7e-4a2f-9240-f618a1c57f8c.png">

After:
<img width="497" alt="Screenshot 2023-04-06 at 19 35 07"
src="https://user-images.githubusercontent.com/115237/230454321-a0be6551-8c31-45e4-a1fb-ffc0d85d87bf.png">
<img width="497" alt="Screenshot 2023-04-06 at 19 38 37"
src="https://user-images.githubusercontent.com/115237/230454570-2fe2aa67-dfa7-4b2e-8c04-8dd40e6e99fc.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoTreat PRs with agit flow as fork PRs when triggering actions. (#23884) (#23967)
Jason Song [Fri, 7 Apr 2023 21:43:12 +0000 (05:43 +0800)]
Treat PRs with agit flow as fork PRs when triggering actions. (#23884) (#23967)

Backport #23884.

There is no fork concept in agit flow, anyone with read permission can
push `refs/for/<target-branch>/<topic-branch>` to the repo. So we should
treat it as a fork pull request because it may be from an untrusted
user.

19 months agoUse Get/Set instead of Rename when Regenerate session id (#23975) (#23983)
Giteabot [Fri, 7 Apr 2023 19:21:20 +0000 (15:21 -0400)]
Use Get/Set instead of Rename when Regenerate session id (#23975) (#23983)

Backport #23975 by @wxiaoguang

Do not use Rename here, because the old sid and new sid may be in
different redis cluster slot.

Fix #23869

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoDo not crash when parsing an invalid workflow file (#23972) (#23976)
Giteabot [Fri, 7 Apr 2023 13:55:59 +0000 (09:55 -0400)]
Do not crash when parsing an invalid workflow file  (#23972) (#23976)

Backport #23972 by @wolfogre

Fix #23658.

Related to https://gitea.com/gitea/act/pulls/39

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoEnsure RSS icon is present on all repo tabs (#23904) (#23973)
Giteabot [Fri, 7 Apr 2023 12:55:30 +0000 (08:55 -0400)]
Ensure RSS icon is present on all repo tabs (#23904) (#23973)

Backport #23904 by @silverwind

Previously, not all repo tabs had shown the RSS icon in the repo header
because the context data was not being set. Added this context data in a
new function.

Before:

<img width="806" alt="image"
src="https://user-images.githubusercontent.com/115237/229639615-9cc00e75-3a26-4ff4-a6f2-316c1fccc596.png">

After:

<img width="815" alt="Screenshot 2023-04-04 at 00 16 17"
src="https://user-images.githubusercontent.com/115237/229639201-2e1c015b-1f13-46d4-aa14-e7a82fab3982.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoHardcode path to docker images (#23955) (#23968)
Giteabot [Fri, 7 Apr 2023 12:54:28 +0000 (08:54 -0400)]
Hardcode path to docker images (#23955) (#23968)

Backport #23955 by @techknowlogick

Fix #23954

This allows for building on platforms that don't have docker hub as the
default container registry.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoTitle can be empty when creating tag only (#23917) (#23961)
Giteabot [Fri, 7 Apr 2023 12:13:57 +0000 (08:13 -0400)]
Title can be empty when creating tag only (#23917) (#23961)

Backport #23917 by @Zettat123

Fixes #23809

Make the title not required. If the title is empty when creating release
(not tag), an error message will be displayed.

![image](https://user-images.githubusercontent.com/15528715/229761056-c52e338b-5f25-4d7d-bb44-2cb0304abcee.png)

Co-authored-by: Zettat123 <zettat123@gmail.com>
19 months agoSupport "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874...
6543 [Fri, 7 Apr 2023 10:10:17 +0000 (12:10 +0200)]
Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874) (#23878)

Backport #23874

19 months agoMerge `push to create`, `open PR from push`, and `push options` docs articles into...
Lunny Xiao [Fri, 7 Apr 2023 07:49:26 +0000 (15:49 +0800)]
Merge `push to create`, `open PR from push`, and `push options` docs articles into one (#23744) (#23959)

backport #23744

19 months agoBackport locales to 1.19 (#23960)
wxiaoguang [Fri, 7 Apr 2023 07:29:54 +0000 (15:29 +0800)]
Backport locales to 1.19 (#23960)

This time the backport is done by `backport-locales.go` automatically,
no manual fix.

However, there are some new broken translations in 1.20 (main branch),
so we must fix our ini package next time, then the broken could be
resolved fundmentally.

19 months agoDelete deleted release attachments immediately from storage (#23913) (#23958)
Giteabot [Thu, 6 Apr 2023 22:38:34 +0000 (18:38 -0400)]
Delete deleted release attachments immediately from storage (#23913) (#23958)

Backport #23913 by @lunny

Previously, deleted release attachments were kept forever on the
external storage.
Note: It may be very slow now if there are many attachments to be
deleted on this release.

Fix #23728

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoLeft-align review comments (#23937)
silverwind [Thu, 6 Apr 2023 07:45:45 +0000 (09:45 +0200)]
Left-align review comments (#23937)

Small extract from https://github.com/go-gitea/gitea/pull/23553 for
1.19:

Before:
<img width="1190" alt="Screenshot 2023-04-05 at 21 47 55"
src="https://user-images.githubusercontent.com/115237/230190330-3cee8904-8558-43ea-b9d3-424d807d0b73.png">

After:
<img width="1181" alt="Screenshot 2023-04-05 at 21 47 38"
src="https://user-images.githubusercontent.com/115237/230190315-c1c3cae5-1bc3-4c2d-bd3d-c119fa01be82.png">

19 months agoFix image border-radius (#23886) (#23930)
Giteabot [Wed, 5 Apr 2023 15:07:44 +0000 (11:07 -0400)]
Fix image border-radius (#23886) (#23930)

Backport #23886 by @wxiaoguang

1. Instead of polluting the `border-radius` style globally, each "img"
usage should declare their own styles.
2. There were some bugs in code, I believe the `.img` selector was done
by mistake.

After:

![image](https://user-images.githubusercontent.com/2114189/229415742-161b018f-14c3-471d-bcf7-34f83e5c2d89.png)

![image](https://user-images.githubusercontent.com/2114189/229415789-829d364a-76da-47a5-8c61-398cc990873c.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoScroll collapsed file into view (#23702) (#23929)
Giteabot [Wed, 5 Apr 2023 10:49:22 +0000 (06:49 -0400)]
Scroll collapsed file into view (#23702) (#23929)

Backport #23702 by @jpraet

Fixes #23701, #23515.

Alternate approach to #23604 using CSS scroll-margin-top, which is also
taken into account for direct links to files in a diff:

* On the PR diff, this currently shows the previous file first:
https://try.gitea.io/jpraet/test/pulls/13/files#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333
* On the commit diff, the first line of the linked file is currently
under the sticky header:
https://try.gitea.io/jpraet/test/commit/1a19e6b14e31d295b7372f3346580c3e85690ff5#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333

Co-authored-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
19 months agodocs: make the required backticks in email password more explicit (#23923) (#23926)
Giteabot [Tue, 4 Apr 2023 19:06:54 +0000 (15:06 -0400)]
docs: make the required backticks in email password more explicit (#23923) (#23926)

Backport #23923 by @teauxfu

updated the example config to make the needed backticks around the
password more obvious

Co-authored-by: alex <alexmw777@gmail.com>
19 months agodocs: fix typo (#23924) (#23925)
Giteabot [Tue, 4 Apr 2023 16:13:09 +0000 (12:13 -0400)]
docs: fix typo (#23924) (#23925)

Backport #23924 by @teauxfu

fixes a minor typo in the email templates page

Co-authored-by: alex <alexmw777@gmail.com>
19 months agoUpdate docs markdown file weight to make it clear (#23909) (#23921)
Lunny Xiao [Tue, 4 Apr 2023 15:27:38 +0000 (23:27 +0800)]
Update docs markdown file weight to make it clear (#23909) (#23921)

backport #23909

19 months agoFix code view (diff) broken layout (#23096) (#23918)
Giteabot [Tue, 4 Apr 2023 14:02:29 +0000 (10:02 -0400)]
Fix code view (diff) broken layout (#23096) (#23918)

Backport #23096 by @wxiaoguang

Close #22911

I think it's ready for review now, feel free to test it, welcome to help
to improve.

### Before

![image](https://user-images.githubusercontent.com/2114189/220958734-06871615-b498-4143-8449-3d443f08ffaa.png)

### After

![image](https://user-images.githubusercontent.com/2114189/220958621-0dce2728-57b8-4a1f-ac5d-48c7c2d42f5c.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoUse ghost user if package creator does not exist (#23822) (#23915)
Giteabot [Tue, 4 Apr 2023 12:37:28 +0000 (08:37 -0400)]
Use ghost user if package creator does not exist (#23822) (#23915)

Backport #23822 by @KN4CK3R

Fixes #23818

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agoOrg pages style fixes (#23901) (#23914)
Giteabot [Tue, 4 Apr 2023 11:05:41 +0000 (07:05 -0400)]
Org pages style fixes (#23901) (#23914)

Backport #23901 by @silverwind

Few fixes/enhancements around org pages:

Use flexbox for member and repo lists and tweak rendering of tabs and
list:

<img width="765" alt="Screenshot 2023-04-03 at 22 54 24"
src="https://user-images.githubusercontent.com/115237/229625716-92a834c3-9121-4729-8b9b-3a3973cf9a91.png">
<img width="771" alt="Screenshot 2023-04-03 at 22 55 15"
src="https://user-images.githubusercontent.com/115237/229625719-acc08ce8-4489-44a6-a9b9-e36755c55b1d.png">

Vertically center remove/leave buttons, add link to avatar:

<img width="1223" alt="Screenshot 2023-04-03 at 21 51 20"
src="https://user-images.githubusercontent.com/115237/229612616-b662b795-e754-41a1-a77a-381c267e6104.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoUser/Org Feed render description as per web (#23887) (#23906)
Giteabot [Tue, 4 Apr 2023 04:44:50 +0000 (00:44 -0400)]
User/Org Feed render description as per web (#23887) (#23906)

Backport #23887 by @6543

User descriptions should be rendered so that links and other markup
appear correct in RSS feeds.

test will be added by #23874

Co-authored-by: 6543 <6543@obermui.de>
19 months agoUse User.ID instead of User.Name in ActivityPub API for Person IRI (#23823) (#23905)
Giteabot [Tue, 4 Apr 2023 03:41:57 +0000 (23:41 -0400)]
Use User.ID instead of User.Name in ActivityPub API for Person IRI (#23823) (#23905)

Backport #23823 by @wxiaoguang

Thanks to @trwnh

Close #23802

The ActivityPub id is an HTTPS URI that should remain constant, even if
the user changes their name.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoAdd git dashes separator to some "log" and "diff" commands (#23606) (#23720)
Giteabot [Tue, 4 Apr 2023 01:43:51 +0000 (21:43 -0400)]
Add git dashes separator to some "log" and "diff" commands (#23606) (#23720)

Backport #23606 by @wxiaoguang

Reference:
https://github.com/go-gitea/gitea/issues/22578#issuecomment-1444180053

Credits to @tdesveaux , thank you very much for catching the problem. If
you'd like to open a PR, feel free to replace this one.

Git reports fatal errors for ambiguous arguments:

```
fatal: ambiguous argument 'refs/a...refs/b': unknown revision or path not in the working tree.
        Use '--' to separate paths from revisions, like this:
        'git <command> [<revision>...] -- [<file>...]'
```

So the `--` separator is necessary in some cases.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoFix `cases.Title` crash for concurrency (#23885) (#23903)
Giteabot [Mon, 3 Apr 2023 23:26:14 +0000 (19:26 -0400)]
Fix `cases.Title` crash for concurrency (#23885) (#23903)

Backport #23885 by @wxiaoguang

Regression of #19676 and #21814

Fix #23872

`cases.Title` is not thread-safe, it has internal state, so it can't be
used as a global shared variable.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoFix user profile description rendering (#23882) (#23902)
Giteabot [Mon, 3 Apr 2023 21:00:24 +0000 (17:00 -0400)]
Fix user profile description rendering (#23882) (#23902)

Backport #23882 by @wxiaoguang

Found an UI problem when testing #23874

The `ul li` styles were polluted.

Before:

![image](https://user-images.githubusercontent.com/2114189/229409756-22438268-ee36-4e4a-a20b-04ee8ee4a79d.png)

After:

![image](https://user-images.githubusercontent.com/2114189/229409809-25cea715-b6f1-4346-9bb4-3fbb58fcca65.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoConvert .Source.SkipVerify to $cfg.SkipVerify (#23839) (#23899)
Giteabot [Mon, 3 Apr 2023 17:02:28 +0000 (13:02 -0400)]
Convert .Source.SkipVerify to $cfg.SkipVerify (#23839) (#23899)

Backport #23839 by @yp05327

`Source` doesn't have `SkipVerify`, it is defined in `cfg`

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoFix review box viewport overflow issue (#23800) (#23898)
Giteabot [Mon, 3 Apr 2023 16:11:08 +0000 (12:11 -0400)]
Fix review box viewport overflow issue (#23800) (#23898)

Backport #23800 by @silverwind

Fix regression that came likely from
https://github.com/go-gitea/gitea/pull/23271:

Long lines of text currently cause the review box's CodeMirror element
to resize which apparently is not recognized by [popper's resize
detection](https://popper.js.org/docs/v2/modifiers/event-listeners/) and
which causes the element to go partially out of viewport until a reflow
happens:

![wrap](https://user-images.githubusercontent.com/115237/228673260-f8ffe89e-5724-4fb9-b93f-30b146c4c436.gif)

Fix this by setting the element to a static width derived from viewport
width and remove the previously clumsy media queries.

Co-authored-by: silverwind <me@silverwind.io>
19 months agoRename actions unit to `repo.actions` and add docs for it (#23733) (#23881)
Giteabot [Mon, 3 Apr 2023 10:54:36 +0000 (06:54 -0400)]
Rename actions unit to `repo.actions` and add docs for it (#23733) (#23881)

Backport #23733 by @wolfogre

I neglected that the `NameKey` of `Unit` is not only for translation,
but also configuration. So it should be `repo.actions` to maintain
consistency.

## :warning: BREAKING :warning:

If users already use `actions.actions` in `DISABLED_REPO_UNITS` or
`DEFAULT_REPO_UNITS`, it will be treated as an invalid unit key.

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoBackport some locales to 1.19 (#23880)
wxiaoguang [Mon, 3 Apr 2023 07:21:42 +0000 (15:21 +0800)]
Backport some locales to 1.19 (#23880)

There are still broken locales (eg: #23866), so this backport is still done manually.

19 months agoFix checks for `needs` in Actions (#23789) (#23831)
Jason Song [Mon, 3 Apr 2023 05:24:45 +0000 (13:24 +0800)]
Fix checks for `needs` in Actions (#23789) (#23831)

Backport #23789.

Fix:
- https://gitea.com/gitea/act_runner/issues/77
- https://gitea.com/gitea/act_runner/issues/81

Before:
<img width="1489" alt="image"

src="https://user-images.githubusercontent.com/9418365/228501567-f752cf87-a7ed-42c6-8f3d-ba741795c1fe.png">

Highlights:
- Upgrade act to make things doable, related to
  - https://gitea.com/gitea/act/pulls/32
  - https://gitea.com/gitea/act/pulls/33
  - https://gitea.com/gitea/act/pulls/35
- Make `needs` works
- Sort jobs in the original order in the workflow files

19 months agoPrefill input values in oauth settings as intended (#23829) (#23871)
Giteabot [Mon, 3 Apr 2023 02:33:12 +0000 (22:33 -0400)]
Prefill input values in oauth settings as intended (#23829) (#23871)

Backport #23829 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoCheck `IsActionsToken` for LFS authentication (#23841) (#23875)
Giteabot [Sun, 2 Apr 2023 20:30:33 +0000 (16:30 -0400)]
Check `IsActionsToken` for LFS authentication (#23841) (#23875)

Backport #23841 by @Zettat123

Close #23824

Actions cannot fetch LFS objects from private repos because we don't
check if the user is the `ActionUser`.

Co-authored-by: Zettat123 <zettat123@gmail.com>
19 months agoRemove assertion debug code for show/hide refactoring (#23576) (#23868)
Giteabot [Sun, 2 Apr 2023 08:20:06 +0000 (04:20 -0400)]
Remove assertion debug code for show/hide refactoring (#23576) (#23868)

Backport #23576 by @wxiaoguang

When doing the refactoring:

* #22950

I added some debug mode code (assertShown) to help to catch bugs, it did
catch some bugs like:

* #23074

If it has been proved that there is no more bugs, this assertion could
be removed easily and clearly.

Feel free to decide when to remove it (feel free to convert it from
Draft to Ready for Review).

19 months agoFix JS error when changing PR's target branch (#23862) (#23864)
Giteabot [Sun, 2 Apr 2023 01:15:46 +0000 (21:15 -0400)]
Fix JS error when changing PR's target branch (#23862) (#23864)

Backport #23862 by @wxiaoguang

Caught by @justusbunsi

An old bug from #6488

In `pullrequest_targetbranch_change`, the `data` might be empty, because
`UpdatePullRequestTarget` may respond `http.StatusNoContent`.

And the old code's `$branchTarget.text(data.base_branch);` doesn't make
sense, because in the end, the page will be always reloaded.

So, just remove the `$branchTarget.text(data.base_branch);`, everything
should be fine.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
19 months agoFix 500 error if there is a name conflict when edit authentication source (#23832...
Giteabot [Fri, 31 Mar 2023 16:53:25 +0000 (12:53 -0400)]
Fix 500 error if there is a name conflict when edit authentication source (#23832) (#23852)

Backport #23832 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoCSS color tweaks (#23828) (#23842)
Giteabot [Fri, 31 Mar 2023 09:24:09 +0000 (05:24 -0400)]
CSS color tweaks (#23828) (#23842)

Backport #23828 by @silverwind

Change grey shades in arc-green to match the theme more:

<img width="661" alt="Screenshot 2023-03-30 at 21 42 34"
src="https://user-images.githubusercontent.com/115237/228957952-8e099e56-6923-4aa6-8ce9-3c1cd898b73e.png">

Adjusted grey shade in light theme:

<img width="652" alt="image"
src="https://user-images.githubusercontent.com/115237/228963876-3bde6181-8397-4dc2-be72-33982e6c7acb.png">

Increase contrast in arc-green, change background to slightly darker
shade, change forgeground to slightly brighter colors:

<img width="283" alt="Screenshot 2023-03-30 at 22 33 20"
src="https://user-images.githubusercontent.com/115237/228957957-272c24a5-dd0b-427a-b6b7-e62836bdd73c.png">

Increase contrast of grey text in light theme as well by making them
darker:

<img width="273" alt="Screenshot 2023-03-30 at 22 33 35"
src="https://user-images.githubusercontent.com/115237/228957959-283139c7-6fa7-4b68-9fdd-16c668ad1301.png">

Add color rule for border multiple select items:

<img width="183" alt="Screenshot 2023-03-30 at 22 29 31"
src="https://user-images.githubusercontent.com/115237/228957954-6b5a752d-bbb0-4519-ab35-d02c0804d955.png">
<img width="181" alt="Screenshot 2023-03-30 at 22 29 46"
src="https://user-images.githubusercontent.com/115237/228957956-fca9790a-d6c9-4f31-8d1b-d183ab3ac669.png">

Added color rule for red `*` on required form fields:

<img width="97" alt="image"
src="https://user-images.githubusercontent.com/115237/228958760-517ad9ef-565d-4349-b734-9b559ab42429.png">

Co-authored-by: silverwind <me@silverwind.io>
19 months agoFix incorrect visibility dropdown list in add/edit user page (#23804) (#23833)
Giteabot [Fri, 31 Mar 2023 08:25:21 +0000 (04:25 -0400)]
Fix incorrect visibility dropdown list in add/edit user page (#23804) (#23833)

Backport #23804 by @yp05327

Visibility dropdown list will not work in add/edit user page when error
occurred

Co-authored-by: yp05327 <576951401@qq.com>
19 months ago[Patch] Fix closed PR also triggers Webhooks and actions (#23782) (#23834)
Giteabot [Fri, 31 Mar 2023 06:29:23 +0000 (02:29 -0400)]
[Patch] Fix closed PR also triggers Webhooks and actions (#23782) (#23834)

Backport #23782 by @sillyguodong

Fix #23707
Cause by #23189
This PR is a quick fix that, when pushing commits to closed PR, webhook
and actions also be triggered.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
19 months agoFix "Updating branch by merge" bug in "update_branch_by_merge.tmpl" (#23790) (#23825)
wxiaoguang [Fri, 31 Mar 2023 04:15:51 +0000 (12:15 +0800)]
Fix "Updating branch by merge" bug in "update_branch_by_merge.tmpl" (#23790) (#23825)

Backport #23790

Fix regression of #22683

Pass all variables into sub-template.

Close #23787

19 months agoAdd ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (...
wxiaoguang [Thu, 30 Mar 2023 14:09:22 +0000 (22:09 +0800)]
Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) (#23791)

Follow #21962

After I eat my own dogfood, I would say that
ONLY_SHOW_RELEVANT_REPOS=false is necessary for many private/enterprise
instances, because many private repositories do not have
"description/topic", users just want to search by their names.

This PR also adds `PageIsExploreRepositories` check, to make code more
strict, because the `search` template is shared for different purpose.

And during the test, I found a bug that the "Search" button didn't
respect the "relevant" parameter, so this PR fixes the bug by the way
together.

19 months agoFix cancel button in the page of project edit not work (#23655) (#23813)
sillyguodong [Thu, 30 Mar 2023 09:15:50 +0000 (17:15 +0800)]
Fix cancel button in the page of project edit not work (#23655) (#23813)

Backport #23655

Before, in project edit page, the cancel button is not work.

https://user-images.githubusercontent.com/33891828/227182731-6478e29f-0e52-48c4-beb0-6a7d1dda6a1d.mov

1. The wrong classname `cancel` was added to the `<a>` tag. That
classname caused the default click event of `<a>` tag to be cancelled.
Because we have the following settings in the global. So I remove the
classname `cancel`.

https://github.com/go-gitea/gitea/blob/9be90a58754061171bbd5025d85d2b891364efd3/web_src/js/features/common-global.js#L325-L327

2. Another change is that page will redirect to the previous page.

https://user-images.githubusercontent.com/33891828/227187326-c653c6d6-9715-440f-a732-ba0a6f012c81.mov

19 months agoBackport locales (with manual fix) (#23808)
wxiaoguang [Thu, 30 Mar 2023 06:58:57 +0000 (14:58 +0800)]
Backport locales (with manual fix) (#23808)

Backport locales (with manual fix)

19 months agoAdd missing translation for `actions.runners.reset_registration_token_success` (...
Jason Song [Thu, 30 Mar 2023 02:05:26 +0000 (10:05 +0800)]
Add missing translation for `actions.runners.reset_registration_token_success` (#23732) (#23781)

Backport #23732.

Used at

https://github.com/go-gitea/gitea/blob/4011821c946e8db032be86266dd9364ccb204118/routers/web/shared/actions/runners.go#L157