-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (33 loc) · 1.15 KB
/
auto_solver.yml
File metadata and controls
41 lines (33 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Auto-solve Daily LeetCode Problem
on:
schedule:
- cron: '1 0 * * *' # Runs daily at 00:01 UTC (1 minute after daily problems are released)
workflow_dispatch: # Allows for manual triggering
jobs:
auto-solve:
runs-on: ubuntu-latest
if: github.repository_owner == 'ContextLab' # only run if on the ContextLab (source) repository!
permissions:
contents: write # Required to push commits back to the repository
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests openai
- name: Run auto-solver
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
python auto_solver.py
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Auto-solve daily LeetCode problem using GPT-5-mini"
branch: main
file_pattern: problems/*/gpt5-mini.md