-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) ยท 1.42 KB
/
move.yml
File metadata and controls
41 lines (36 loc) ยท 1.42 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: Move New Folder to LeetCode
# on:
# push:
# branches: [main]
# paths:
# - '*/**' # ๋ชจ๋ ์ต์์ ๋๋ ํ ๋ฆฌ ๋ด์ ๋ณ๊ฒฝ ์ฌํญ์ ๋ํด ๋ฐ์ํฉ๋๋ค.
# jobs:
# move-folder:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: '0' # ๋ชจ๋ ์ปค๋ฐ์ ๊ฐ์ ธ์ต๋๋ค.
# - name: Move new folder to LeetCode
# run: |
# # ๋ง์ง๋ง ์ปค๋ฐ์์ ์ถ๊ฐ๋ ๋ชจ๋ ํญ๋ชฉ์ ์ฐพ์ต๋๋ค.
# ADDED_ITEMS=$(git diff --diff-filter=A --name-only ${{ github.event.before }} ${{ github.sha }})
# echo "Added items: $ADDED_ITEMS"
# # ์ถ๊ฐ๋ ํญ๋ชฉ๋ค ์ค ์ต์์ ๋๋ ํ ๋ฆฌ๋ง ์ฐพ์ LeetCode ํด๋๋ก ์ด๋ํฉ๋๋ค.
# for ITEM in $ADDED_ITEMS; do
# if [[ -d $ITEM && $ITEM != "LeetCode/" && $ITEM != "LeetCode/*" ]]; then
# # ์ต์์ ๋๋ ํ ๋ฆฌ๋ฅผ LeetCode ํด๋๋ก ์ด๋ํฉ๋๋ค.
# mv $ITEM LeetCode/
# # ๋ณ๊ฒฝ ์ฌํญ์ ์ปค๋ฐํฉ๋๋ค.
# git add .
# git commit -m "Move $ITEM to LeetCode directory"
# fi
# done
# # ์ด๋๋ ํญ๋ชฉ์ด ์์ผ๋ฉด ํธ์ํฉ๋๋ค.
# if git status | grep -q 'Changes to be committed'; then
# git push origin main
# else
# echo "No changes to push"
# fi
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}