You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This is a basic workflow to help you get started with Actionsname: Weather_Email_Bot# Controls when the action will run. on:
# Triggers the workflow on push events but only for the main branchpush:
branches: [ main ]# schedule:# - cron: '00 00 * * *'# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in paralleljobs:
# This workflow contains a single job called "build"hello-job:
# The type of runner that the job will run onruns-on: ubuntu-latest# Steps represent a sequence of tasks that will be executed as part of the jobsteps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2# Runs a single command using the runners shell
- name: Run a one-line scriptrun: echo Hello, world!# weather jobweather-email-bot:
runs-on: ubuntu-lateststeps:
- name: 'Checkout codes'uses: actions/checkout@v1# 自动获取天气信息
- name: 'Get Weather'run: bash ./weather.sh# 自定义 env, $GITHUB_ENV => ${{env.REPORT_DATE}}
- name: 'Get Date'run: echo "REPORT_DATE=$(TZ=':Asia/Shanghai' date '+%Y-%m-%d %T')" >> $GITHUB_ENV# 自动发送邮件
- name: 'Send mail'uses: dawidd6/action-send-mail@masterwith:
server_address: smtp.163.comserver_port: 465# username: ${{ secrets.MAIL_USERNAME }}# password: ${{ secrets.MAIL_PASSWORD }}username: ${{ secrets.MAILUSERNAME }}password: ${{ secrets.MAILPASSWORD }}# fix secrets name bug ✅subject: Shanghai Weather Report (${{env.REPORT_DATE}})body: file://result.htmlto: ${{ secrets.MAILTO }}from: GitHub Actionscontent_type: text/html# test
- name: 'Print Name bug'run: | echo "secrets.MAILUSERNAME = " ${{ secrets.MAILUSERNAME }}
- name: 'Print GITHUB_ENV env ✅'run: | echo "❓ env.REPORT_DATE = " ${{env.REPORT_DATE}}
The text was updated successfully, but these errors were encountered:
GitHub Actions workflow env.REPORT_DATE ✅
https://github.com/xgqfrms/weather-email-action/actions/runs/6094061170/job/16534840070
The text was updated successfully, but these errors were encountered: