Skip to content

Commit f3cc006

Browse files
lunnysilverwindZettat123
authored
Update actions variables documents (#30394)
Fix #30393 --------- Co-authored-by: silverwind <[email protected]> Co-authored-by: Zettat123 <[email protected]>
1 parent 50dbed6 commit f3cc006

File tree

4 files changed

+80
-60
lines changed

4 files changed

+80
-60
lines changed

docs/content/usage/actions/act-runner.en-us.md

-31
Original file line numberDiff line numberDiff line change
@@ -303,34 +303,3 @@ sudo systemctl enable act_runner --now
303303
```
304304

305305
If using Docker, the `act_runner` user should also be added to the `docker` group before starting the service. Keep in mind that this effectively gives `act_runner` root access to the system [[1]](https://docs.docker.com/engine/security/#docker-daemon-attack-surface).
306-
307-
## Configuration variable
308-
309-
You can create configuration variables on the user, organization and repository level.
310-
The level of the variable depends on where you created it.
311-
312-
### Naming conventions
313-
314-
The following rules apply to variable names:
315-
316-
- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.
317-
318-
- Variable names must not start with the `GITHUB_` and `GITEA_` prefix.
319-
320-
- Variable names must not start with a number.
321-
322-
- Variable names are case-insensitive.
323-
324-
- Variable names must be unique at the level they are created at.
325-
326-
- Variable names must not be `CI`.
327-
328-
### Using variable
329-
330-
After creating configuration variables, they will be automatically filled in the `vars` context.
331-
They can be accessed through expressions like `{{ vars.VARIABLE_NAME }}` in the workflow.
332-
333-
### Precedence
334-
335-
If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence:
336-
A repository variable will always be chosen over an organization/user variable.

docs/content/usage/actions/act-runner.zh-cn.md

-29
Original file line numberDiff line numberDiff line change
@@ -258,32 +258,3 @@ Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们
258258
Runner将从Gitea实例获取Job并自动运行它们。
259259

260260
由于Act Runner仍处于开发中,建议定期检查最新版本并进行升级。
261-
262-
## 变量
263-
264-
您可以创建用户、组织和仓库级别的变量。变量的级别取决于创建它的位置。
265-
266-
### 命名规则
267-
268-
以下规则适用于变量名:
269-
270-
- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。
271-
272-
- 变量名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。
273-
274-
- 变量名称不能以数字开头。
275-
276-
- 变量名称不区分大小写。
277-
278-
- 变量名称在创建它们的级别上必须是唯一的。
279-
280-
- 变量名称不能为 “CI”。
281-
282-
### 使用
283-
284-
创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `{{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。
285-
286-
### 优先级
287-
288-
如果同名变量存在于多个级别,则级别最低的变量优先。
289-
仓库级别的变量总是比组织或者用户级别的变量优先被选中。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
date: "2024-04-10T22:21:00+08:00"
3+
title: "Variables"
4+
slug: "actions-variables"
5+
sidebar_position: 25
6+
draft: false
7+
toc: false
8+
menu:
9+
sidebar:
10+
parent: "actions"
11+
name: "Variables"
12+
sidebar_position: 25
13+
identifier: "actions-variables"
14+
---
15+
16+
## Variables
17+
18+
You can create configuration variables on the user, organization and repository level.
19+
The level of the variable depends on where you created it. When creating a variable, the
20+
key will be converted to uppercase. You need use uppercase on the yaml file.
21+
22+
### Naming conventions
23+
24+
The following rules apply to variable names:
25+
26+
- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.
27+
- Variable names must not start with the `GITHUB_` and `GITEA_` prefix.
28+
- Variable names must not start with a number.
29+
- Variable names are case-insensitive.
30+
- Variable names must be unique at the level they are created at.
31+
- Variable names must not be `CI`.
32+
33+
### Using variable
34+
35+
After creating configuration variables, they will be automatically filled in the `vars` context.
36+
They can be accessed through expressions like `${{ vars.VARIABLE_NAME }}` in the workflow.
37+
38+
### Precedence
39+
40+
If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence:
41+
A repository variable will always be chosen over an organization/user variable.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
date: "2024-04-10T22:21:00+08:00"
3+
title: "变量"
4+
slug: "actions-variables"
5+
sidebar_position: 25
6+
draft: false
7+
toc: false
8+
menu:
9+
sidebar:
10+
parent: "actions"
11+
name: "变量"
12+
sidebar_position: 25
13+
identifier: "actions-variables"
14+
---
15+
16+
## 变量
17+
18+
您可以创建用户、组织和仓库级别的变量。变量的级别取决于创建它的位置。当创建变量时,变量的名称会被
19+
转换为大写,在yaml文件中引用时需要使用大写。
20+
21+
### 命名规则
22+
23+
以下规则适用于变量名:
24+
25+
- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。
26+
- 变量名称不能以 `GITHUB_``GITEA_` 前缀开头。
27+
- 变量名称不能以数字开头。
28+
- 变量名称不区分大小写。
29+
- 变量名称在创建它们的级别上必须是唯一的。
30+
- 变量名称不能为 `CI`
31+
32+
### 使用
33+
34+
创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `${{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。
35+
36+
### 优先级
37+
38+
如果同名变量存在于多个级别,则级别最低的变量优先。
39+
仓库级别的变量总是比组织或者用户级别的变量优先被选中。

0 commit comments

Comments
 (0)