Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for 1.21 actions #26317

Merged
merged 3 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions docs/content/usage/actions/act-runner.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ You can find more useful images on [act images](https://github.com/nektos/act/bl
If you want to run jobs in the host directly, you can change it to `ubuntu-22.04:host` or just `ubuntu-22.04`, the `:host` is optional.
However, we suggest you to use a special name like `linux_amd64:host` or `windows:host` to avoid misusing it.

One more thing is that it is recommended to register the runner if you want to change the labels.
It may be annoying to do this, so we may provide a better way to do it in the future.
After Gitea 1.21 released, you can change labels by modfiying `container.labels` in configuration file (if you don't have a configuration file, please refer to [configuration tutorials](#configuration)), and runner will declare the new labels which you defined in configuration file after executing `./act_runner daemon --config config.yaml`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After Gitea 1.21 released, you can change labels by modfiying `container.labels` in configuration file (if you don't have a configuration file, please refer to [configuration tutorials](#configuration)), and runner will declare the new labels which you defined in configuration file after executing `./act_runner daemon --config config.yaml`.
Starting with Gitea 1.21, you can change labels by modifying `container.labels` in the runner configuration file (if you don't have a configuration file, please refer to [configuration tutorials](#configuration)).
The runner will use these new labels as soon as you restart it, i.e., by calling `./act_runner daemon --config config.yaml`.


## Running

Expand All @@ -261,3 +260,32 @@ After you have registered the runner, you can run it by running the following co
The runner will fetch jobs from the Gitea instance and run them automatically.

Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly.

## Configuration variable

You can create configuration varibales with user, organization, repository level. And the level of the variable depends on which setting panel you created in.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can create configuration varibales with user, organization, repository level. And the level of the variable depends on which setting panel you created in.
You can create configuration variables on the user, organization, and repository level.
The level of the variable depends on where you created it.


### Naming conventions

The following rules apply to variable names:

- Varibale names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.

- Varibale names must not start with the `GITHUB_` and `GITEA_` prefix.

- Varibale names must not start with a number.

- Varibale names are not case-sensitive.

- Varibale names must be unique at the level they are created at.

- Varibale names must not be 'CI'.
Comment on lines +272 to +282
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Varibale names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.
- Varibale names must not start with the `GITHUB_` and `GITEA_` prefix.
- Varibale names must not start with a number.
- Varibale names are not case-sensitive.
- Varibale names must be unique at the level they are created at.
- Varibale names must not be 'CI'.
- Variable names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.
- Variable names must not start with the `GITHUB_` and `GITEA_` prefix.
- Variable names must not start with a number.
- Variable names are case-insensitive.
- Variable names must be unique at the level they are created at.
- Variable names must not be `CI`.


### Using varibales

After creating configuration varibales, they will be automatically filled in the `vars` context. They are available to you with expression like `{{ vars.VARIABLE_NAME }}` in workflow.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After creating configuration varibales, they will be automatically filled in the `vars` context. They are available to you with expression like `{{ vars.VARIABLE_NAME }}` in workflow.
After creating configuration variables, they will be automatically filled in the `vars` context. They can be accessed through expressions like `{{ vars.VARIABLE_NAME }}` in the workflow.


### Precedence

If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence(the level of organization and user is higher than repository's).
For example, if an organization-level variable has the same name as a repository-level variable, then the repository-level variable takes precedence.
Comment on lines +290 to +291
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence(the level of organization and user is higher than repository's).
For example, if an organization-level variable has the same name as a repository-level variable, then the repository-level variable takes precedence.
If a variable with the same name exists at multiple levels, the variable at the lowest level takes precedence:
A repository variable will always be chosen over an organization/user variable.

32 changes: 30 additions & 2 deletions docs/content/usage/actions/act-runner.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们
如果您想直接在主机上运行Job,您可以将其更改为`ubuntu-22.04:host`或仅`ubuntu-22.04`,`:host`是可选的。
然而,我们建议您使用类似`linux_amd64:host`或`windows:host`的特殊名称,以避免误用。

还有一点需要注意的是,建议在更改标签时注册Runner。
这可能会有些麻烦,所以我们可能会在将来提供更好的方法来处理。
Gitea 1.21 发布后,您可以通过修改配置文件中的 `container.labels` 来更改标签(如果没有配置文件,请参考 [配置教程](#配置)),执行 `./act_runner daemon --config config.yaml` 命令后,它会向 Gitea 声明您在配置文件中定义的新标签。

## 运行

Expand All @@ -257,3 +256,32 @@ Runner的标签用于确定Runner可以运行哪些Job以及如何运行它们
Runner将从Gitea实例获取Job并自动运行它们。

由于Act Runner仍处于开发中,建议定期检查最新版本并进行升级。

## 变量

您可以创建用户、组织和仓库级别的变量。变量的级别是取决于你在哪个设置面板中创建它们的。

### 命名规则

以下规则适用于变量名:

- 变量名称只能包含字母数字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下划线 (`_`)。不允许使用空格。

- 变量名称不能以 `GITHUB_` 和 `GITEA_` 前缀开头。

- 变量名称不能以数字开头。

- 变量名称不区分大小写。

- 变量名称在创建它们的级别上必须是唯一的。

- 变量名称不能为 “CI”。

### 使用

创建配置变量后,它们将自动填充到 `vars` 上下文中。您可以在工作流中使用类似 `{{ vars.VARIABLE_NAME }}` 这样的表达式来使用它们。

### 优先级

如果同名变量存在于多个级别,则级别最低的变量优先(组织和用户的级别高于仓库)。
比如,如果组织级变量与仓库级变量同名,则仓库变量优先。