Files
docs/i18n/zh-cn/docs/current/usage/actions/comparison.md
T
2af7b60fd9 docs(actions): document OIDC workload identity (#526)
Document the OpenID Connect tokens that Gitea Actions jobs can request since https://github.com/go-gitea/gitea/pull/39052, so they can sign in to cloud providers without long-lived secrets.

- Add an OpenID Connect page covering how to trust Gitea, request a token and match its claims
- Document the `id-token` permission scope and its maximum
- Translate both for zh-cn and zh-tw, which still listed `id-token` as unsupported

Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/526
Reviewed-by: silverwind <[email protected]>
Co-authored-by: Max P. <[email protected]>
2026-10-18 07:12:16 +00:00

4.2 KiB

date, slug, sidebar_position
date slug sidebar_position
2023-05-24T15:00:00+08:00 comparison 15

与GitHub Actions的对比

Gitea Actions旨在与GitHub Actions兼容,差异如下。

额外功能

Action URL绝对路径

uses:支持指向任意Git托管平台的绝对URL,例如uses: https://gitea.com/actions/checkout@v4。

Action前缀

uses:支持以下前缀:

  • self:引用您自己的Gitea实例,例如uses: self:owner/repo@v1或uses: self:owner/repo/.gitea/workflows/build.yml@v1
  • builtin:运行Gitea Runner内置的Action,无需下载,Job镜像中也无需Node,例如uses: builtin:checkout

builtin:checkout支持actions/checkout的repository、ref、token、path和fetch-depth输入,默认值相同,其他输入会使步骤失败。

相对于工作流的Actions

$/引用工作流所在的仓库和提交,或外层复合Action所在的仓库和提交,例如uses: $/.gitea/actions/build。 与./不同,它无需事先检出代码。

使用Go编写Actions

请参阅创建Go Actions。

支持非标准的调度语法 @yearly, @monthly, @weekly, @daily, @hourly

schedule还支持@yearly、@monthly、@weekly、@daily和@hourly,而GitHub不支持。

不支持的工作流语法

jobs.<job_id>.environment

jobs.<job_id>.environment会被忽略。

复杂的runs-on

runs-on支持:

  • 静态字符串:runs-on: self-hosted
  • 标签数组:runs-on: [linux, self-hosted]
  • 字符串表达式:runs-on: ${{ github.event_name == 'push' && 'ubuntu-latest' || 'self-hosted' }}
  • 包含表达式的数组:runs-on: [linux, "${{ github.event_name == 'push' && 'ubuntu-latest' || 'self-hosted' }}"]

缺失的功能

软件包仓库授权

GITEA_TOKEN无法发布到其所属仓库的软件包注册表,例如无法推送OCI镜像。 请改用个人访问令牌,参见此问题。

问题匹配器

问题匹配器会被忽略。

为错误创建注释

错误注释会被忽略。

表达式

表达式支持GitHub的标准函数和上下文。

缺失的UI功能

预处理和后处理步骤

预处理和后处理步骤在Job日志中没有单独的区块。

服务步骤

服务步骤在Job日志中没有单独的区块。

不一样的行为

permissions和jobs.<job_id>.permissions

permissions和jobs.<job_id>.permissions控制GITEA_TOKEN的权限,该权限受仓库和所有者设置的限制,并在fork拉取请求和跨仓库访问时受到进一步限制。 不支持statuses、checks、deployments、security-events和pages等GitHub专有的权限范围,而Gitea额外提供了code、releases、wiki和projects。id-token与GitHub相同,请参阅OpenID Connect。 请参阅Actions Job令牌权限。

下载Actions

未指定主机的Actions(如uses: actions/checkout@v4)会从https://github.com下载,当[actions].DEFAULT_ACTIONS_URL为self时则从您自己的实例下载。 请参阅配置备忘单。 其他来源请参阅Action URL绝对路径、Action前缀和相对于工作流的Actions。

上下文可用性

不检查上下文可用性,因此env等上下文可以在更多地方使用。