Skip to content

.github/workflows/check_domain.yml#185

Open
liubynb1753-blip wants to merge 8 commits into
vignesh07:mainfrom
liubynb1753-blip:main
Open

.github/workflows/check_domain.yml#185
liubynb1753-blip wants to merge 8 commits into
vignesh07:mainfrom
liubynb1753-blip:main

Conversation

@liubynb1753-blip

Copy link
Copy Markdown

name: 域名状态定时监测

on:
schedule:
- cron: '02* * *' # 每天北京时间上午9点自动运行
workflow_dispatch: # 允许你手动点按钮运行

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: 检测并发送通知
run: |
# ↓↓↓ 把下面引号里的域名换成你自己的,空格隔开 ↓↓↓
DOMAINS="hj5p.h2xv7hi1jh3.com"

      REPORT="🌐 域名状态报告:%0A"
      for domain in $DOMAINS; do
        status=$(curl -Is https://$domain --connect-timeout 5 | head -n 1)
        if [[ $status == *"200"* || $status == *"301"* || $status == *"302"* ]]; then
          REPORT="$REPORT ✅ $domain 正常%0A"
        else
          REPORT="$REPORT ❌ $domain 异常%0A"
        fi
      done
      curl -s -X POST "https://telegram.org{{ secrets.TELEGRAM_TOKEN }}/sendMessage" \
        -d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}&text=$REPORT"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant