Skip to content

Sync main → develop #87

Sync main → develop

Sync main → develop #87

Workflow file for this run

name: Sync main → develop
# 서버 crontab이 main 에 쌓는 콘텐츠(docs/ · blog/ · static/img/)를
# develop 으로 정기 흡수한다.
#
# .notion-sync.json 충돌은 자동 해소 (main 버전 채택).
# 그 외 파일 충돌은 실패 → 수동 개입 강제.
on:
schedule:
- cron: '0 18 * * *' # 매일 UTC 18:00 = KST 03:00
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout develop (full history)
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- name: Merge main into develop
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin main
if git merge origin/main -m "chore: main → develop 흡수 [skip-notion]"; then
git push origin develop
echo "머지 완료 (충돌 없음)"
exit 0
fi
# 충돌 발생 — .notion-sync.json 이외의 충돌 파일 확인
NON_SYNC=$(git diff --name-only --diff-filter=U | grep -v '\.notion-sync\.json$' || true)
if [ -n "$NON_SYNC" ]; then
echo "실제 충돌 감지 — 수동 해결 필요:"
echo "$NON_SYNC"
exit 1
fi
# .notion-sync.json 충돌만 존재 → main 버전으로 자동 해소
echo ".notion-sync.json 충돌 자동 해소 (main 버전 채택)"
git diff --name-only --diff-filter=U | xargs -r git checkout origin/main --
git add -A
git commit -m "chore: main → develop 흡수 (sync-json 충돌 자동 해소) [skip-notion]"
git push origin develop