-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (35 loc) · 1.08 KB
/
process_leetcode.yml
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
42
43
44
name: Process LeetCode Problems
on:
workflow_run:
workflows: ["Sync Leetcode"]
types:
- completed
permissions:
contents: write
jobs:
process:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ github.token }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Create problems directory
run: mkdir -p problems
- name: Process problems
run: go run scripts/process_problems.go
- name: Rename problems in 0 directory
run: go run leetcode-db/cmd/populate-db/main.go
- name: Commit directory changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add problems/
git add -u # This will stage deletions of the old directories
git commit -m "Move and rename problems" || echo "No changes to commit"
git push