Skip to content

foyoux/started-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

started-notify

GitHub repository started notify 💕

当有人标星(Star)你的仓库时,发送一封包含标星者信息(头像、昵称、个人主页)及当前 Star 总数的精美邮件通知。

✨ 特性

  • 实时通知:利用 GitHub Actions 的 watch 事件触发。
  • 详细信息:邮件包含标星者的头像、用户名、个人资料链接。
  • 统计数据:显示当前仓库的 Star 总数。
  • 自动获取邮箱:如果未指定接收邮箱,尝试自动获取仓库所有者的公开邮箱。

🚀 使用方法

1. 添加 Workflow 文件

在你的仓库中创建文件 .github/workflows/started_notify.yml,并填入以下内容:

name: Star Notify
on:
  watch:
    types: [ started ]
jobs:
  Notify:
    runs-on: ubuntu-latest
    steps:
      - name: Download Script
        run: |
          wget https://raw.githubusercontent.com/foyoux/started-notify/main/.github/workflows/started_notify.py#${{github.run_id}}
      - name: Send Email
        env:
          SMTP_HOST: ${{ secrets.NOTIFY_SMTP_HOST }}
          SMTP_PORT: ${{ secrets.NOTIFY_SMTP_PORT }}
          SMTP_USER: ${{ secrets.NOTIFY_SMTP_USER }}
          SMTP_PASSWORD: ${{ secrets.NOTIFY_SMTP_PASSWORD }}
          STARGAZER_LOGIN: ${{ github.actor }}
        run: |
          python started_notify.py ${{github.token}} "${{secrets.NOTIFY_EMAIL}}"

2. 配置 Secrets

进入仓库的 Settings -> Secrets and variables -> Actions,添加以下 Repository secrets:

Secret Name 说明 示例 / 备注
NOTIFY_SMTP_HOST SMTP 服务器地址 smtp.qq.com (QQ邮箱), smtp.gmail.com
NOTIFY_SMTP_PORT SMTP 端口 (SSL) 465
NOTIFY_SMTP_USER 发件人邮箱账号 example@qq.com
NOTIFY_SMTP_PASSWORD 邮箱授权码/密码 QQ邮箱需使用授权码
NOTIFY_EMAIL (可选) 接收通知的邮箱 如果不设置,将尝试发送给仓库所有者的公开邮箱

🖼️ 效果预览

Notification Email Preview

About

星标邮件提醒 💕

Topics

Resources

License

Stars

Watchers

Forks