Skip to content

Commit e9d3619

Browse files
authored
Merge branch 'main' into clean-template-helper
2 parents 37f5766 + 17623bb commit e9d3619

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+569
-253
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.20-alpine3.17 AS build-env
2+
FROM docker.io/library/golang:1.20-alpine3.17 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -23,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2323
# Begin env-to-ini build
2424
RUN go build contrib/environment-to-ini/environment-to-ini.go
2525

26-
FROM alpine:3.17
26+
FROM docker.io/library/alpine:3.17
2727
LABEL maintainer="[email protected]"
2828

2929
EXPOSE 22 3000

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.20-alpine3.17 AS build-env
2+
FROM docker.io/library/golang:1.20-alpine3.17 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -23,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2323
# Begin env-to-ini build
2424
RUN go build contrib/environment-to-ini/environment-to-ini.go
2525

26-
FROM alpine:3.17
26+
FROM docker.io/library/alpine:3.17
2727
LABEL maintainer="[email protected]"
2828

2929
EXPOSE 2222 3000

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ generate-go: $(TAGS_PREREQ)
747747

748748
.PHONY: security-check
749749
security-check:
750-
go run $(GOVULNCHECK_PACKAGE) -v ./...
750+
go run $(GOVULNCHECK_PACKAGE) ./...
751751

752752
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
753753
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@

docs/content/doc/usage/push-options.en-us.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/content/doc/usage/push-options.zh-tw.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/content/doc/usage/push-to-create.en-us.md renamed to docs/content/doc/usage/push.en-us.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,51 @@
11
---
22
date: "2020-07-06T16:00:00+02:00"
3-
title: "Push To Create"
4-
slug: "push-to-create"
3+
title: "Usage: Push"
4+
slug: "push"
55
weight: 15
66
toc: false
77
draft: false
88
menu:
99
sidebar:
1010
parent: "usage"
11-
name: "Push To Create"
11+
name: "Push"
1212
weight: 15
13-
identifier: "push-to-create"
13+
identifier: "push"
1414
---
1515

16+
**Table of Contents**
17+
18+
{{< toc >}}
19+
20+
There are some additional features when pushing commits to Gitea server.
21+
22+
# Open PR through Push
23+
24+
When you push commits to a non-default branch for the first time,
25+
you will receive a link you can click on to visit the compare page of your branch compared to your main branch.
26+
From there, it's easy to create a pull request, even if you want to target another branch.
27+
28+
![Gitea Push Hint](/gitea-push-hint.png)
29+
30+
# Push Options
31+
32+
In Gitea `1.13`, support for some [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)
33+
were added.
34+
35+
## Supported Options
36+
37+
- `repo.private` (true|false) - Change the repository's visibility.
38+
39+
This is particularly useful when combined with push-to-create.
40+
41+
- `repo.template` (true|false) - Change whether the repository is a template.
42+
43+
Example of changing a repository's visibility to public:
44+
45+
```shell
46+
git push -o repo.private=false -u origin main
47+
```
48+
1649
# Push To Create
1750

1851
Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default.
@@ -35,6 +68,4 @@ git push -u origin main
3568

3669
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.
3770

38-
## Push options (bonus)
39-
40-
Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`. To explicitly set the visibility, you can use a [push option]({{< relref "doc/usage/push-options.en-us.md" >}}).
71+
Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`.

docs/content/doc/usage/push.zh-tw.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
date: "2020-07-06T16:00:00+02:00"
3+
title: "使用: Push"
4+
slug: "push"
5+
weight: 15
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "usage"
11+
name: "Push"
12+
weight: 15
13+
identifier: "push"
14+
---
15+
16+
**Table of Contents**
17+
18+
{{< toc >}}
19+
20+
There are some additional features when pushing commits to Gitea server.
21+
22+
# Push Merge Hint
23+
24+
When you pushing commits to a non-default branch, you will get an information from
25+
Gitea which is a link, you can click the link and go to a compare page. It's a quick
26+
way to create a pull request or a code review yourself in the Gitea UI.
27+
28+
![Gitea Push Hint](/gitea-push-hint.png)
29+
30+
# Push Options
31+
32+
Gitea 從 `1.13` 版開始支援某些 [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)
33+
34+
35+
## 支援的 Options
36+
37+
- `repo.private` (true|false) - 修改儲存庫的可見性。
38+
39+
與 push-to-create 一起使用時特別有用。
40+
41+
- `repo.template` (true|false) - 修改儲存庫是否為範本儲存庫。
42+
43+
以下範例修改儲存庫的可見性為公開:
44+
45+
```shell
46+
git push -o repo.private=false -u origin main
47+
```
48+
49+
# Push To Create
50+
51+
Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default.
52+
53+
## Enabling Push To Create
54+
55+
In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet]({{< relref "doc/administration/config-cheat-sheet.zh-tw.md#repository-repository" >}}).
56+
57+
## Using Push To Create
58+
59+
Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command:
60+
61+
```shell
62+
# Add the remote you want to push to
63+
git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git
64+
65+
# push to the remote
66+
git push -u origin main
67+
```
68+
69+
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.

docs/static/gitea-push-hint.png

412 KB
Loading

models/actions/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type ActionRun struct {
3636
TriggerUser *user_model.User `xorm:"-"`
3737
Ref string
3838
CommitSHA string
39-
IsForkPullRequest bool
39+
IsForkPullRequest bool // If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow.
4040
NeedApproval bool // may need approval if it's a fork pull request
4141
ApprovedBy int64 `xorm:"index"` // who approved
4242
Event webhook_module.HookEventType

models/fixtures/org_user.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,9 @@
7575
uid: 31
7676
org_id: 19
7777
is_public: true
78+
79+
-
80+
id: 14
81+
uid: 5
82+
org_id: 23
83+
is_public: false

0 commit comments

Comments
 (0)