├── task.sh ├── .github └── workflows │ └── planting-grass.yml └── README.md /task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "DATE: $1" >> date.txt 4 | -------------------------------------------------------------------------------- /.github/workflows/planting-grass.yml: -------------------------------------------------------------------------------- 1 | # 1. 저장소 Fork 2 | # 2. 해당 파일 A, B 절차에 따라 수정 3 | # 3. 수정사항 커밋 후 푸쉬 & Enjoy! 4 | 5 | name: planting-grass 6 | 7 | # A. 8~11 라인 주석 처리 8 | on: 9 | push: 10 | branches: 11 | - unknown 12 | 13 | # B. 14~16 라인 주석 해제 14 | # on: 15 | # schedule: 16 | # - cron: '0 0 * * *' 17 | 18 | jobs: 19 | task: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Set current date 24 | id: date 25 | run: echo "::set-output name=date::$(date +'%Y-%m-%d')" 26 | - name: Execute commands 27 | run: sh ./task.sh ${{ steps.date.outputs.date }} 28 | - name: Commit files 29 | run: | 30 | # 이전의 커밋 기록에서 사용자 이름 및 이메일을 자동으로 추출합니다! 31 | git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" 32 | git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" 33 | git add date.txt 34 | git commit -m ${{ steps.date.outputs.date }} 35 | - name: Push changes 36 | uses: ad-m/github-push-action@master 37 | with: 38 | github_token: ${{ secrets.GITHUB_TOKEN }} 39 | branch: ${{ github.ref }} 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |