Daily folder (KST midnight) #50
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: Daily folder (KST midnight) | |
| on: | |
| schedule: | |
| # KST 00:00 = UTC 15:00 (전날) | |
| - cron: '0 15 * * *' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| jobs: | |
| create_today_folder: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set timezone to Asia/Seoul | |
| run: | | |
| sudo timedatectl set-timezone Asia/Seoul | |
| date | |
| - name: Create today's folder with subfolders | |
| id: mk | |
| run: | | |
| TODAY=$(date +'%Y-%m-%d') | |
| ROOT_DIR="${TODAY}" | |
| if [ -d "$ROOT_DIR" ]; then | |
| echo "Directory $ROOT_DIR already exists." | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| mkdir -p "$ROOT_DIR/곽태근" | |
| mkdir -p "$ROOT_DIR/김호집" | |
| mkdir -p "$ROOT_DIR/오창은" | |
| mkdir -p "$ROOT_DIR/김태민" | |
| mkdir -p "$ROOT_DIR/추창우" | |
| mkdir -p "$ROOT_DIR/김대환" | |
| mkdir -p "$ROOT_DIR/김소희" | |
| mkdir -p "$ROOT_DIR/유현아" | |
| # 빈 폴더 커밋을 위해 .gitkeep 파일 추가 | |
| touch "$ROOT_DIR/곽태근/.gitkeep" | |
| touch "$ROOT_DIR/김호집/.gitkeep" | |
| touch "$ROOT_DIR/오창은/.gitkeep" | |
| touch "$ROOT_DIR/김태민/.gitkeep" | |
| touch "$ROOT_DIR/추창우/.gitkeep" | |
| touch "$ROOT_DIR/김대환/.gitkeep" | |
| touch "$ROOT_DIR/김소희/.gitkeep" | |
| touch "$ROOT_DIR/유현아/.gitkeep" | |
| echo "Created $ROOT_DIR with subfolders." | |
| echo "TODAY=$TODAY" >> $GITHUB_ENV | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Commit & push if changed | |
| if: steps.mk.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "${TODAY:-$(date +'%Y-%m-%d')}일자 태스크 배정완료, 화이팅!" | |
| git push |