Check SSL Certificate Expiration #152
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check SSL Certificate Expiration | |
| on: | |
| # 每天北京时间上午10点运行 (UTC 时间 2:00) | |
| schedule: | |
| - cron: '0 2 * * *' | |
| # 允许在 Actions 页面手动触发 | |
| workflow_dispatch: | |
| jobs: | |
| check-certs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 步骤1: 检出你的代码 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 步骤2: 设置 Python 环境 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| # 步骤3: 安装依赖库 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| # 步骤4: 运行检测脚本 | |
| - name: Run SSL check script | |
| env: | |
| # --- 从 GitHub Secrets and Variables 读取配置 --- | |
| # 必填: 你的 Bark Key | |
| BARK_KEY: ${{ secrets.BARK_KEY }} | |
| # 必填: 逗号分隔的域名列表 | |
| DOMAINS: ${{ secrets.DOMAINS }} | |
| # 选填: 你的自建 Bark 服务器地址 | |
| BARK_URL: ${{ secrets.BARK_URL }} | |
| # 选填: 过期提醒阈值,默认为 30 天 | |
| DAYS_THRESHOLD: ${{ vars.DAYS_THRESHOLD || 30 }} | |
| run: python check_ssl.py |