Daily Email #300
This file contains 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: Daily Email | |
on: | |
workflow_dispatch: | |
schedule: | |
# runs at 12 AM UTC (5:30 AM IST) | |
- cron: "0 0 * * *" | |
permissions: # Global permissions configuration starts here | |
contents: write # 'read' access to repository contents | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests redmail | |
- name: Send email | |
env: | |
PASSWORD: ${{ secrets.PASSWORD }} | |
USEREMAIL: ${{ secrets.USEREMAIL }} | |
run: python main.py | |
- name: commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git diff-index --quiet HEAD || (git commit -a -m "add: Updating GitHub Follower Counting" --allow-empty) | |
- name: push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.TOKEN }} | |
branch: main |