Jason Song
60173297aa
chore: lint codes
2023-01-05 12:14:56 +08:00
Jason Song
b884772652
Apply suggestions from code review
...
Co-authored-by: delvh <dev.lh@web.de >
2023-01-05 11:59:32 +08:00
Jason Song
95167fd0a2
chore: rename to NumActionRuns
2023-01-04 18:52:22 +08:00
Jason Song
7f6a803d24
fix: omit total in FindTasks
2023-01-04 18:52:22 +08:00
Jason Song
53afbcecad
Merge branch 'main' into feature/bots
2023-01-03 09:43:23 +08:00
John Olheiser
fcd6ceef2b
fix: code search title translation ( #22285 )
...
`code.title` isn't an existing translation.
`explore.code` is the translation used for the tab, which I think
matches closely enough for this instead of a brand new translation.
Open to feedback on whether a new translation would be preferred
instead.
Signed-off-by: jolheiser <john.olheiser@gmail.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: Lauris BH <lauris@nix.lv >
2023-01-02 17:18:08 +08:00
delvh
0f4e1b9ac6
Restructure webhook module ( #22256 )
...
Previously, there was an `import services/webhooks` inside
`modules/notification/webhook`.
This import was removed (after fighting against many import cycles).
Additionally, `modules/notification/webhook` was moved to
`modules/webhook`,
and a few structs/constants were extracted from `models/webhooks` to
`modules/webhook`.
Co-authored-by: 6543 <6543@obermui.de >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-01-01 23:23:15 +08:00
Gusted
b76970f2e4
Fix key signature error page ( #22229 )
...
- When the GPG key contains an error, such as an invalid signature or an
email address that does not match the user.A page will be shown that
says you must provide a signature for the token.
- This page had two errors: one had the wrong translation key and the
other tried to use an undefined variable
[`.PaddedKeyID`](e81ccc406b/models/asymkey/gpg_key.go (L65-L72) ),
which is a function implemented on the `GPGKey` struct, given that we
don't have that, we use
[`KeyID`](e81ccc406b/routers/web/user/setting/keys.go (L102) )
which is [the fingerprint of the
publickey](https://pkg.go.dev/golang.org/x/crypto/openpgp/packet#PublicKey.KeyIdString )
and is a valid way for opengpg to refer to a key.
Before:

After:

Co-authored-by: zeripath <art27@cantab.net >
2022-12-30 12:53:05 +08:00
Jason Song
133437d4eb
Merge branch 'main' into feature/bots
2022-12-30 09:36:51 +08:00
Jason Song
47efba78ec
Support template for merge message description ( #22248 )
...
Fix #21435 .
Use the first line of the template as the git commit message title, and
the rest as the description.
## Snapshots
<img width="806" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644083-5d85179c-cf58-404f-bc98-c662398a2411.png ">
<img width="860" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644392-22573090-e2c1-458b-ba44-855b79735632.png ">
<img width="1154" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644457-a1b2711a-6787-45b4-b52c-a88d7fc132d7.png ">
Co-authored-by: delvh <dev.lh@web.de >
2022-12-29 14:40:20 +02:00
Jason Song
c84094011e
fix: import
2022-12-29 15:02:10 +08:00
Jason Song
f11a31e54e
Merge branch 'main' into feature/bots
2022-12-29 14:51:21 +08:00
Jason Song
8717c428ea
fix: CanRerun
2022-12-29 14:48:45 +08:00
Jason Song
bc7b575ade
fix: update locale
2022-12-29 14:29:49 +08:00
KN4CK3R
a35749893b
Move convert package to services ( #22264 )
...
Addition to #22256
The `convert` package relies heavily on different models which is
[disallowed by our definition of
modules](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#design-guideline ).
This helps to prevent possible import cycles.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-12-29 10:57:15 +08:00
KN4CK3R
309e86a9bf
Use dynamic package type list ( #22263 )
...
Replace the hardcoded list with the dynamic list.
2022-12-29 00:31:54 +01:00
Jason Song
1f48a9ad6f
fix: check if can_cancel and can_rerun
2022-12-28 18:18:11 +08:00
Jason Song
c355172878
fix: check reqRepoActionsWriter
2022-12-28 13:30:17 +08:00
Jason Song
d995fc6281
Merge branch 'main' into feature/bots
2022-12-28 13:29:46 +08:00
Xinyu Zhou
7cc7db73b9
Add option to prohibit fork if user reached maximum limit of repositories ( #21848 )
...
If user has reached the maximum limit of repositories:
- Before
- disallow create
- allow fork without limit
- This patch:
- disallow create
- disallow fork
- Add option `ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT` (Default **true**) :
enable this allow user fork repositories without maximum number limit
fixed https://github.com/go-gitea/gitea/issues/21847
Signed-off-by: Xinyu Zhou <i@sourcehut.net >
2022-12-27 15:21:14 -06:00
Jason Song
6cf09ccab4
Use complete SHA to create and query commit status ( #22244 )
...
Fix #13485 .
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: Lauris BH <lauris@nix.lv >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-12-27 21:12:49 +08:00
Jason Song
9eafbada53
chore: reorganize locale of actions
2022-12-22 17:29:41 +08:00
Jason Song
c326ea5c20
chore: update copyright
2022-12-22 16:56:10 +08:00
Jason Song
d183b32aa8
Merge branch 'main' into feature/bots
2022-12-22 12:00:41 +08:00
Reo
48d71b7d6b
Add Feed for Releases and Tags ( #21696 )
...
Fixes #19091
Add Feed for Releases and Tags, can be accessed through
`reponame/releases.rss`, `reponame/releases.atom`, `reponame/tags.rss`,
and `reponame/tags.atom`
Signed-off-by: Reo <reo_999@proton.me >
2022-12-21 15:06:26 -06:00
Nick
c4df10d219
Repair LFS web rendering. ( #22195 )
...
There was just a missing check.
Fixes #22193 .
Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca >
2022-12-21 09:21:26 +08:00
Jason Song
659055138b
Secrets storage with SecretKey encrypted ( #22142 )
...
Fork of #14483 , but [gave up
MasterKey](https://github.com/go-gitea/gitea/pull/14483#issuecomment-1350728557 ),
and fixed some problems.
Close #12065 .
Needed by #13539 .
Featrues:
- Secrets for repo and org, not user yet.
- Use SecretKey to encrypte/encrypt secrets.
- Trim spaces of secret value.
- Add a new locale ini block, to make it easy to support secrets for
user.
Snapshots:
Repo level secrets:

Rrg level secrets

Co-authored-by: Lauris BH <lauris@nix.lv >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: KN4CK3R <admin@oldschoolhack.me >
2022-12-20 17:07:13 +08:00
Jason Song
9c3395c556
chore: removed to shared
2022-12-19 18:44:14 +08:00
Jason Song
ab98c3ff43
Merge branch 'main' into feature/bots
2022-12-19 18:26:28 +08:00
zeripath
6e22605793
Ensure that plain files are rendered correctly even when containing ambiguous characters ( #22017 )
...
As recognised in #21841 the rendering of plain text files is somewhat
incorrect when there are ambiguous characters as the html code is double
escaped. In fact there are several more problems here.
We have a residual isRenderedHTML which is actually simply escaping the
file - not rendering it. This is badly named and gives the wrong
impression.
There is also unusual behaviour whether the file is called a Readme or
not and there is no way to get to the source code if the file is called
README.
In reality what should happen is different depending on whether the file
is being rendered a README at the bottom of the directory view or not.
1. If it is rendered as a README on a directory - it should simply be
escaped and rendered as `<pre>` text.
2. If it is rendered as a file then it should be rendered as source
code.
This PR therefore does:
1. Rename IsRenderedHTML to IsPlainText
2. Readme files rendered at the bottom of the directory are rendered
without line numbers
3. Otherwise plain text files are rendered as source code.
Replace #21841
Signed-off-by: Andrew Thornton <art27@cantab.net >
Signed-off-by: Andrew Thornton <art27@cantab.net >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-12-17 22:22:25 +02:00
Lunny Xiao
1b32ed014a
remove duplicated read file code ( #22042 )
...
Merge the duplicated read file code as one function in reading text file
and readme file.
2022-12-14 18:11:11 +08:00
Jason Song
6c622137f1
Merge branch 'main' into feature/bots
2022-12-13 09:50:18 +08:00
Lunny Xiao
87c64f655a
Fix permission check on issue/pull lock ( #22110 )
...
Fix #21826
2022-12-12 23:02:51 +08:00
Lunny Xiao
36a2d2f919
Add a simple test for external renderer ( #20033 )
...
Fix #16402
2022-12-12 20:45:21 +08:00
Jason Song
ef20a02af0
fix: use web.Bind
2022-12-12 18:55:23 +08:00
Jason Song
1c9288f3dd
fix: list runners
2022-12-12 18:52:52 +08:00
Jason Song
cc19ab5ced
Merge branch 'main' into feature/bots
2022-12-12 17:29:51 +08:00
Lunny Xiao
6398ca745a
refactor bind functions based on generics ( #22055 )
2022-12-12 16:09:26 +08:00
Lunny Xiao
705fbb46d5
Fix permission check on http push
2022-12-12 14:52:00 +08:00
Jason Song
59c3707da2
Merge branch 'main' into feature/bots
2022-12-12 13:33:24 +08:00
Lunny Xiao
003b4e209c
Allow disable code tab ( #20805 )
...
I know some users created a repository in an organization but just use
issues and projects to handle the whole organizations issues. So that
`Code` could be disabled per repository.
<img width="1148" alt="image"
src="https://user-images.githubusercontent.com/81045/184792075-346cb508-b620-4adb-bc9a-cba76fdcb294.png ">
It could also become a wiki repository.
<img width="1173" alt="image"
src="https://user-images.githubusercontent.com/81045/184792324-e15c6f68-35c0-4105-ab77-83585ce53672.png ">
Co-authored-by: delvh <dev.lh@web.de >
2022-12-12 13:29:27 +08:00
Jason Song
dfa1b6168d
Merge branch 'main' into feature/bots
2022-12-12 10:46:13 +08:00
aceArt-GmbH
352a50d65f
Fix sorting admin user list by last login ( #22081 )
...
Admin User Account list sort
`updated_unix` is not the same as "Last Sign-In"
2022-12-11 18:00:17 -06:00
Lunny Xiao
68704532c2
Rename almost all Ctx functions ( #22071 )
2022-12-10 10:46:31 +08:00
Jason Song
d378a78c79
Merge branch 'main' into feature/bots
2022-12-09 16:20:28 +08:00
Jason Song
10ebbeca2f
chore: rename to action
2022-12-09 15:29:26 +08:00
KN4CK3R
3c59d31bc6
Add API management for issue/pull and comment attachments ( #21783 )
...
Close #14601
Fix #3690
Revive of #14601 .
Updated to current code, cleanup and added more read/write checks.
Signed-off-by: Andrew Thornton <art27@cantab.net >
Signed-off-by: Andre Bruch <ab@andrebruch.com >
Co-authored-by: zeripath <art27@cantab.net >
Co-authored-by: 6543 <6543@obermui.de >
Co-authored-by: Norwin <git@nroo.de >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-12-09 14:35:56 +08:00
Jason Song
26b87561b6
fix: deal with empty repo
2022-12-06 18:32:26 +08:00
Jason Song
223782ca4c
refactor: rename to actions
2022-12-06 15:16:25 +08:00
Jason Song
56368f3963
refactor: use ctx in models
2022-12-06 14:15:48 +08:00