-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1018 Bytes
/
move-leetcode.yml
File metadata and controls
46 lines (37 loc) · 1018 Bytes
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
45
name: Move LeetCode Solutions
on:
push:
paths:
- '[0-9][0-9][0-9][0-9]-*/**'
workflow_dispatch:
jobs:
move-leetcode:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync with remote
run: |
git pull --rebase origin main
- name: Move LeetCode directories
run: |
mkdir -p leetcode
for d in [0-9][0-9][0-9][0-9]-*; do
if [ -d "$d" ]; then
mv "$d" leetcode/
fi
done
- name: Commit and push
run: |
if git status --porcelain | grep .; then
git add -A
git commit -m "chore: move leetcode solutions into leetcode folder"
git push origin main
fi