Update move-leetcode.yml #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Organize LeetCode problems | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write # ๊นํ๋ธ ์ก์ ์ด repo์ pushํ ์ ์๋๋ก ๊ถํ ๋ถ์ฌ | |
| jobs: | |
| organize: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Move LeetCode problem folders | |
| run: | | |
| mkdir -p LeetCode | |
| for dir in [0-9][0-9][0-9][0-9]-*; do | |
| if [ -d "$dir" ]; then | |
| echo "Moving $dir -> LeetCode/$dir" | |
| # ๊ธฐ์กด ํด๋๊ฐ ์์ผ๋ฉด ์ญ์ ํ ์ด๋ | |
| rm -rf "LeetCode/$dir" | |
| mv "$dir" LeetCode/ | |
| fi | |
| done | |
| - name: Commit changes | |
| run: | | |
| git config --global user.name "leegyuho-programer" | |
| git config --global user.email "101032270+leegyuho-programer@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: auto-move LeetCode problem folders to /LeetCode" || echo "No changes" | |
| git push |