Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9ed21bd4d | ||
|
|
323bf9bfdb | ||
|
|
507124d91c |
@@ -2,6 +2,12 @@
|
||||
|
||||
Gitea Actions 公共 action 仓库。
|
||||
|
||||
> **维护模式**(2026-07-16 起):本仓库**独立发布**(自己打 tag:`v1.x.y`)。
|
||||
> `gitea_admin/docker-gitea` 仓库通过 **git submodule** 把本仓库作为 `ci-actions/`
|
||||
> 子目录引入,方便在 docker-gitea 仓库内查看/同步代码;
|
||||
> 但所有 action 改动与发版都**在本仓库**进行(commit + push + tag),业务仓库
|
||||
> workflow 的 `uses:` URL 仍指向本仓库 `http://gitea:3000/gitea_admin/ci-actions/<name>@<tag>`。
|
||||
|
||||
通过 `uses: gitea_admin/ci-actions/<name>@v1` 在业务 workflow 中复用,
|
||||
避免每个仓库重复实现。
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ secret 走 org-level(gitea_admin org 已配)。
|
||||
|
||||
| Input | Default | 说明 |
|
||||
|---|---|---|
|
||||
| `channels` | `both` | 通知通道:`both` / `bark` / `email` |
|
||||
| `title` | `[${{ github.repository }}] ${{ github.workflow }}` | Bark 推送标题 |
|
||||
| `email_subject` | `[gitea-ci] ${{ github.repository }} - ${{ inputs.status }}` | 邮件主题 |
|
||||
| `bark_device_key` | `${{ secrets.BARK_DEVICE_KEY }}` | Bark key(org secret) |
|
||||
@@ -70,6 +71,17 @@ run: http://gitea:3000/gitea_admin/<repo>/actions/runs/<id>
|
||||
|
||||
业务 repo 不需要再配 secret。
|
||||
|
||||
## 选通道
|
||||
|
||||
```yaml
|
||||
- uses: http://gitea:3000/gitea_admin/ci-actions/notify-all@v1.2.0
|
||||
with:
|
||||
status: ${{ needs.build.result }}
|
||||
channels: email # 只发邮件(不推 Bark)
|
||||
```
|
||||
|
||||
可选值:`both`(默认)/ `bark` / `email`。
|
||||
|
||||
## 内部实现
|
||||
|
||||
`notify-all` 是 composite action,内部 chain 调 sibling action:
|
||||
|
||||
@@ -12,6 +12,10 @@ inputs:
|
||||
status:
|
||||
description: 'Build job status (caller passes ${{ needs.<job>.result }})'
|
||||
required: true
|
||||
channels:
|
||||
description: 'Notification channels: both (default) / bark / email'
|
||||
required: false
|
||||
default: 'both'
|
||||
title:
|
||||
description: 'Notification title'
|
||||
required: false
|
||||
@@ -74,7 +78,9 @@ runs:
|
||||
echo "value=${SHORT}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# 2. Push to Bark(链式调 sibling action,完整 URL 因为 act_runner 0.2.11 不支持 ./relative)
|
||||
# 默认走 bark + email (channels=both),可传 channels=bark 只推 bark / channels=email 只发邮件
|
||||
- name: Push to Bark
|
||||
if: ${{ inputs.channels != 'email' }}
|
||||
uses: http://gitea:3000/gitea_admin/ci-actions/notify-bark@v1.1.2
|
||||
with:
|
||||
device_key: ${{ inputs.bark_device_key }}
|
||||
@@ -92,6 +98,7 @@ runs:
|
||||
|
||||
# 3. Send email
|
||||
- name: Send email
|
||||
if: ${{ inputs.channels != 'bark' }}
|
||||
uses: http://gitea:3000/gitea_admin/ci-actions/notify-email@v1.1.2
|
||||
with:
|
||||
smtp_host: ${{ inputs.smtp_host }}
|
||||
|
||||
Reference in New Issue
Block a user