-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (38 loc) · 1.27 KB
/
GetWeatherToEMail.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: GitHub Actions Weather Bot
# 触发条件:在 push 到 main 分支后
on:
push:
schedule:
- cron: '0 21 * * *'
jobs:
bot:
runs-on: ubuntu-latest
steps:
- name: 'Check out the repository to the runner'
uses: actions/checkout@v4
- name: 'Make the script files executable'
shell: bash
working-directory: ./.github/workflows
run: chmod +x weather.sh
- name: 'Get weather report'
working-directory: ./.github/workflows
shell: bash
run: |
./weather.sh
- name: 'Send mail'
uses: dawidd6/action-send-mail@master
with:
server_address: smtp.qq.com
server_port: 25
username: ${{ secrets.MAILUSERNAME }}
password: ${{ secrets.MAILPASSWORD }}
from: XiNan GitHub Actions
subject: Shenzhen Weather Report
html_body: file://./.github/workflows/result.html
# Optional carbon copy recipients:
# Optional blind carbon copy recipients:
# Optional priority: 'high', 'normal' (default) or 'low'
# priority: low