8000 delete: debug js · vsme/chinese-days@5d08425 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Send Email on Holidays Update #2239

Send Email on Holidays Update

Send Email on Holidays Update #2239

Workflow file for this run

name: Send Email on Holidays Update
on:
schedule:
# 从 00:00 到 10:00 UTC,每 2 小时运行一次(对应北京时间 08:00 到 06:00)
- cron: '0 0-10/2 * * *'
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install
- name: Run script
id: run-script
run: npm run fetch ${{ vars.HOLIDAYS_YEAR }}
- name: Read holidays file
id: read-holidays
run: |
echo "HOLIDAYS_CONTENT=$(cat holidays.html)" >> $GITHUB_ENV
env:
HOLIDAYS_CONTENT: $(cat holidays.html)
- name: Send notification if holidays has value
if: ${{ steps.run-script.outputs.holidays != '' }}
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: "${{ vars.HOLIDAYS_YEAR }} Holidays Update"
to: ${{ secrets.TO_EMAIL }}
from: Holidays Update
html_body: ${{ env.HOLIDAYS_CONTENT }}
0