Update main.yml
This commit is contained in:
22
.github/workflows/main.yml
vendored
22
.github/workflows/main.yml
vendored
@@ -33,11 +33,21 @@ jobs:
|
|||||||
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
|
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
|
||||||
TO_EMAIL: 1627832236@qq.com
|
TO_EMAIL: 1627832236@qq.com
|
||||||
run: |
|
run: |
|
||||||
echo "Subject: 推送仓库成功" > email.txt
|
# 1. 构建邮件内容
|
||||||
echo "From: $EMAIL_USER" >> email.txt
|
email_content=$(cat <<EOF
|
||||||
echo "To: $TO_EMAIL" >> email.txt
|
From: $EMAIL_USER
|
||||||
echo "" >> email.txt
|
To: $TO_EMAIL
|
||||||
echo "有新的内容推送到仓库toutoukan" >> email.txt
|
Subject: 推送仓库成功
|
||||||
sendmail -S "$SMTP_SERVER:$SMTP_PORT" -au"$EMAIL_USER" -ap"$EMAIL_PASS" $TO_EMAIL < email.txt
|
通知:有新的内容已推送到仓库「toutoukan」的main分支,
|
||||||
|
可登录GitHub查看具体更新。
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
# 2. 用curl发送邮件
|
||||||
|
curl -v "smtps://$SMTP_SERVER:$SMTP_PORT"
|
||||||
|
--mail-from "$EMAIL_USER"
|
||||||
|
--mail-rcpt "$TO_EMAIL"
|
||||||
|
--user "$EMAIL_USER:$EMAIL_PASS"
|
||||||
|
-T <(echo "$email_content")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user