LeetCode Rank Tracking Job Scheduler #5167
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: LeetCode Rank Tracking Job Scheduler | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pandas matplotlib pytz | |
- name: run job | |
run: | | |
python3 -m tracker --username egg528 | |
- name: commit changes | |
run: | | |
git config --global user.name 'leetcode-rank-tracker' | |
git config --global user.email 'leetcode-rank-tracker@gmail.com' | |
git add -u | |
git add * | |
if git diff --cached --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m "docs: update leetcode rank" | |
fi | |
- name: Push changes | |
run: | | |
git push origin main |