123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- name: Notify on Result
- on:
- push:
- branches:
- - main # 或者你想要的其他分支
- 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 2024
- - name: Debug secrets
- run: echo "SECRET_TEST=${{ secrets.SECRET_TEST }}"
- shell: bash
- - 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: "2024 Holidays Result has value - GitHub Actions"
- to: hi@yaavi.me
- from: Github
- body: |
- Result has value: $(cat holidays.txt)
|