Time: 10 ms (30.44%), Space: 60.8 MB (20.57%) - LeetHub #9
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: 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 | |