Skip to content

Commit d390271

Browse files
added github action to automatically add each day's daily problem to the readme
1 parent eebd3d0 commit d390271

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/update_readme.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update README with LeetCode Daily Challenge
2+
3+
on:
4+
schedule:
5+
- cron: '1 0 * * *' # Runs daily at 00:01 UTC
6+
workflow_dispatch: # Allows for manual triggering
7+
8+
jobs:
9+
update-readme:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install requests beautifulsoup4
25+
26+
- name: Run update_readme.py
27+
run: python update_readme.py
28+
29+
- name: Create GitHub issue on failure
30+
if: failure()
31+
uses: peter-evans/create-issue-from-file@v2
32+
with:
33+
title: "Update README with LeetCode Daily Challenge Failed"
34+
content: |
35+
The GitHub Action to update README with LeetCode Daily Challenge has failed.
36+
Please check the workflow logs for more details.
37+
labels: bug

0 commit comments

Comments
 (0)