Skip to content

Update README calendar (KST daily) #4

Update README calendar (KST daily)

Update README calendar (KST daily) #4

name: Update README calendar (KST daily)
on:
schedule:
# KST 00:02 = UTC 15:02 (전날)
- cron: '2 15 * * *'
workflow_dispatch: {}
permissions:
contents: write
jobs:
update_calendar:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 달력 집계용으로 이전 커밋까지 모두 필요
- name: Set timezone to Asia/Seoul
run: |
sudo timedatectl set-timezone Asia/Seoul
date
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Generate calendar into README
run: |
python3 scripts/update_readme_calendar.py
- name: Commit & push if changed
run: |
if git diff --quiet README.md; then
echo "No changes in README.md"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
KST_NOW=$(date +'%Y-%m-%d %H:%M')
git commit -m "README 달력 자동 업데이트: ${KST_NOW} KST"
git push