Update README with LeetCode Daily Challenge #126
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: Update README with LeetCode Daily Challenge | |
on: | |
schedule: | |
- cron: '1 0 * * *' # Runs daily at 00:01 UTC | |
workflow_dispatch: # Allows for manual triggering | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'ContextLab' # only run if on the ContextLab (source) repository! | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests beautifulsoup4 | |
- name: Fetch and update README with daily LeetCode problem details | |
run: python update_readme.py | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Update README with LeetCode Daily Challenge" | |
branch: main | |
file_pattern: README.md |