将ip标题改为:Github来源ip #93
This file contains 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: 'GitHub Actions Weather Bot' | |
on: | |
push: | |
schedule: | |
- cron: '0 6 * * *' | |
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/Shanghai' date '+%Y-%m-%d %T')" >> $GITHUB_ENV | |
- name: 'Get IP Address' | |
run: echo "IP_ADDRESS=$(curl -s https://api64.ipify.org?format=json | jq -r '.ip')" >> $GITHUB_ENV | |
- name: 'Send mail' | |
uses: dawidd6/action-send-mail@master | |
with: | |
server_address: smtp.office365.com | |
server_port: 587 | |
username: ${{ secrets.MAIL_USERNAME }} | |
password: ${{ secrets.MAIL_PASSWORD }} | |
subject: 荆州每日天气 (${{env.REPORT_DATE}}) | |
body: | | |
Github来源ip: ${{ env.IP_ADDRESS }} | |
file://result.html | |
to: ${{ secrets.MAIL_TO }} | |
from: 气象每日快报/JingZhou | |
content_type: text/html |