Send Email On Cron Schedule #465
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: Send Email On Cron Schedule | |
| env: | |
| SENDER_EMAIL: ${{secrets.SENDER_EMAIL}} | |
| SENDER_EMAIL_PASS: ${{secrets.SENDER_EMAIL_PASSWORD}} | |
| RECIPIENTS_LIST_IND: ${{secrets.RECIPIENTS_LIST_IND}} | |
| RECIPIENTS_LIST_UK: ${{secrets.RECIPIENTS_LIST_UK}} | |
| on: | |
| # The Cron Schedule | |
| schedule: | |
| - cron: "*/30 * * * 1" | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Run script | |
| run: python 'Intermediate/Day 32 - Email Sender/main.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) |