Files
gitea-docs/i18n/zh-tw/docusaurus-plugin-content-docs/version-1.22/usage/actions/variables.md
Lunny Xiao 965c269495 Update zh tw languages and fix some broken links (#455)
---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <2021+silverwind@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/docs/pulls/455
Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
2026-07-09 23:41:46 +00:00

33 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
date: "2024-04-10T22:21:00+08:00"
slug: "actions-variables"
sidebar_position: 25
---
## 變量
您可以建立使用者、組織和儲存庫級別的變量。變量的級別取決於建立它的位置。當建立變量時,變量的名稱會被
轉換為大寫在yaml文件中引用時需要使用大寫。
### 命名規則
以下規則適用於變量名:
- 變量名稱只能包含字母數字字符 (`[a-z]`, `[A-Z]`, `[0-9]`) 或下劃線 (`_`)。不允許使用空格。
- 變量名稱不能以 `GITHUB_``GITEA_` 前綴開頭。
- 變量名稱不能以數字開頭。
- 變量名稱不區分大小寫。
- 變量名稱在建立它們的級別上必須是唯一的。
- 變量名稱不能為 `CI`
### 使用
建立設定變量後,它們將自動填充到 `vars` 上下文中。您可以在工作流中使用類似 `${{ vars.VARIABLE_NAME }}` 這樣的表達式來使用它們。
### 優先級
如果同名變量存在於多個級別,則級別最低的變量優先。
儲存庫級別的變量總是比組織或者使用者級別的變量優先被選中。