Rain Alert Email #2251
This file contains hidden or 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: Rain Alert Email | |
| env: | |
| SENDER_EMAIL: ${{secrets.SENDER_EMAIL}} | |
| OW_API_KEY: ${{secrets.OW_API_KEY}} | |
| SENDER_EMAIL_PASS: ${{secrets.SENDER_EMAIL_PASSWORD}} | |
| RECIPIENTS_LIST_UK_RAIN_ALERT: ${{secrets.RECIPIENTS_LIST_UK_RAIN_ALERT}} | |
| on: | |
| schedule: | |
| - cron: | |
| '*/10 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: python set up | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: requirements | |
| run: pip install -r requirements.txt | |
| - name: send-email | |
| run: python3 'Intermediate/Day 35 - Rain Alert System/send_email.py' | |
| - name: Push changes to Git | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'Github@action.com' | |
| git add . || true | |
| git status | |
| git diff-index --quiet HEAD || (git commit -m 'Updated by GitHub Actions' && git push) |