Skip to content

auto-commit

auto-commit #59

Workflow file for this run

name: auto-commit
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set current datetime as env variable
env:
TZ: 'Asia/Tokyo'
run: echo "CURRENT_DATETIME=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
- name: Commit
run: |
git config --global user.email ${{ secrets.USER_EMAIL }}
git config --global user.name ${{ secrets.USER_NAME }}
echo -e ${{ env.CURRENT_DATETIME }} >> commit_log.txt
git add commit_log.txt
git commit -m "[add] 自動コミット:${{ env.CURRENT_DATETIME }}"
git push origin main