Files
ci-actions/notify-email/README.md
T
gitea_admin 25e21fd0c7
lint / yamllint (push) Successful in 12s
feat(notify-email): composite action 通过 SMTP 发邮件 + lint workflow
- notify-email 用 curl smtps:// 协议,163/126 兼容
- self-mail 模式:USER/TO 可同账号
- 失败时 ::warning:: 不阻塞
- lint workflow: yamllint 验证 action.yml 语法
2026-07-13 09:36:06 +08:00

1.3 KiB
Raw Permalink Blame History

notify-email

通过 SMTP 发送 Gitea Actions run 结果邮件。已验证兼容 163 / 126 邮箱

Inputs

名称 必填 默认 说明
smtp_host 例:smtp.163.com
smtp_port 465 SSL 端口
smtp_user 完整邮箱地址
smtp_pass 授权码(业务 repo 配 Gitea secret
from = smtp_user 发件人
to 收件人,多个用逗号
subject 邮件主题
body 邮件正文(纯文本)

使用示例

- uses: gitea_admin/ci-actions/notify-email@v1
  with:
    smtp_host: smtp.163.com
    smtp_user: ${{ secrets.EMAIL_USER }}
    smtp_pass: ${{ secrets.EMAIL_SMTP_PASS }}
    to: ${{ secrets.EMAIL_TO }}
    subject: "[gitea-ci] ${{ github.repository }} - ${{ needs.build.result }}"
    body: |
      repository: ${{ github.repository }}
      workflow: ${{ github.workflow }}
      status: ${{ needs.build.result }}
      url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

安全

smtp_pass 必须通过 Gitea secret 传入,不要直接写在 workflow 里。

失败处理

邮件发送失败时输出 ::warning::Email send failed (non-fatal)不阻塞调用方 job。