lint / yamllint (push) Successful in 6m52s
新 input:
channels: 默认 'both'(同时推 Bark + 发邮件)
可选 'bark'(只推 Bark)/ 'email'(只发邮件)
实现:composite step 加 'if' 条件
Push to Bark: if ${{ inputs.channels != 'email' }}
Send email: if ${{ inputs.channels != 'bark' }}
兼容:未传 channels 时默认 both,向后兼容 v1.1.x 用法。
README.md / docker-gitea/docs/ci-actions.md 同步更新。
notify-all
Bark iOS push + SMTP email in one step. Designed for zero-config when paired with org-level (or instance-level) secrets on Gitea.
Usage (极简 / recommended)
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "your build steps"
notify:
needs: build
if: always()
runs-on: ubuntu-latest
steps:
- name: notify
uses: http://gitea:3000/gitea_admin/ci-actions/notify-all@v1
with:
status: ${{ needs.build.result }}
That's it — Bark 推送 + 邮件发送全自动,body/title/subject 自动从 github.* + inputs.status 拼,
secret 走 org-level(gitea_admin org 已配)。
必传
| Input | 来源 | 说明 |
|---|---|---|
status |
caller → ${{ needs.build.result }} |
唯一必传,用于拼 body / subject |
可选 inputs(全部有默认值)
| 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) |
bark_server |
https://api.day.app |
Bark server(自建时改) |
bark_group |
gitea-ci |
Bark 分组 |
bark_level |
active |
active / timeSensitive / passive / default |
smtp_host |
smtp.163.com |
SMTP host |
smtp_port |
465 |
SMTP SSL 端口 |
smtp_user |
${{ secrets.EMAIL_USER }} |
发件邮箱(org secret) |
smtp_pass |
${{ secrets.EMAIL_SMTP_PASS }} |
SMTP 授权码(org secret) |
to |
${{ secrets.EMAIL_TO }} |
收件邮箱(org secret) |
body 不再是 input(v1.1.2 起),由 notify-all 自动拼(status / branch / commit / sha 前 10 位 / actor / run)。如需自定义 body,绕开 notify-all 直接用 notify-bark + notify-email。
自动拼的 body 格式
status: success
branch: main
commit: ci: any commit message
sha: 29a4454e0 # ← 只取前 10 位
actor: gitea_admin
run: http://gitea:3000/gitea_admin/<repo>/actions/runs/<id>
依赖的 org-level secret(gitea_admin org 已配)
BARK_DEVICE_KEYEMAIL_USEREMAIL_SMTP_PASSEMAIL_TO
业务 repo 不需要再配 secret。
选通道
- 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:
uses: ./notify-barkuses: ./notify-email
v1.1.0 tag 下三个 action 自包含,runner 拉一次仓库就够。
失败处理
Bark / Email 任一失败 → ::warning:: 输出 → step 仍 Success → job 不阻塞。
(继承自 notify-bark / notify-email 的 curl --retry 2 + if ! 包裹逻辑。)