Files
docs/i18n/zh-tw/docs/current/usage/actions/variables.md
T
Lunny Xiao 2275bef3bd refactor: rename i18n/*/docusaurus-plugin-content-docs to i18n/*/docs (#588)
Drops the leftover docusaurus name from the translated content directories.

- git mv i18n/{en-us,zh-cn,zh-tw}/docusaurus-plugin-content-docs -> i18n/{locale}/docs (pure renames, content unchanged)
- update the paths in packages/content-loader/src/products.ts, scripts/cut-version.mjs and sites/docs/README.md

current.json / version-*.json keep their names and stay beside the content.

Verified: pnpm build succeeds, 6690 pages built.

<!-- cloudflare-preview --> Preview: https://pr-588.docs-gitea-com.pages.dev
Reviewed-on: https://gitea.com/gitea/docs/pulls/588
Reviewed-by: Zettat123 <[email protected]>
2026-10-12 21:05:07 +00:00

1.1 KiB

date, slug, sidebar_position
date slug sidebar_position
2024-04-10T22:21:00+08:00 actions-variables 25

變量

您可以建立使用者、組織和儲存庫級別的變量。變量的級別取決於建立它的位置。當建立變量時,變量的名稱會被 轉換為大寫,在yaml文件中引用時需要使用大寫。

命名規則

以下規則適用於變量名:

  • 變量名稱只能包含字母數字字符 ([a-z], [A-Z], [0-9]) 或下劃線 (_)。不允許使用空格。
  • 變量名稱不能以 GITHUB_ 和 GITEA_ 前綴開頭。
  • 變量名稱不能以數字開頭。
  • 變量名稱不區分大小寫。
  • 變量名稱在建立它們的級別上必須是唯一的。
  • 變量名稱不能為 CI。

使用

建立設定變量後,它們將自動填充到 vars 上下文中。您可以在工作流中使用類似 ${{ vars.VARIABLE_NAME }} 這樣的表達式來使用它們。

優先級

如果同名變量存在於多個級別,則級別最低的變量優先。 儲存庫級別的變量總是比組織或者使用者級別的變量優先被選中。