Skip to content

GitHub Actions Weather Bot #4

GitHub Actions Weather Bot

GitHub Actions Weather Bot #4

Workflow file for this run

name: 'GitHub Actions Weather Bot'
on:
# push:
workflow_dispatch:
schedule:
- cron: '0 16 * * *'
jobs:
bot:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
uses: actions/checkout@v1
- name: 'Get Weather'
run: bash ./weather.sh
- name: 'Get Date'
run: echo "REPORT_DATE=$(TZ=':Asia/Wuhan' date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: 'Send mail'
uses: dawidd6/action-send-mail@master
with:
server_address: smtp.qq.com
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: 天气预报-Wuhan (${{env.REPORT_DATE}})
html_body: file://result.html
to: 307330552@qq.com
from: GitHub Actions