Skip to content

Sync and Summarize FE News #6

Sync and Summarize FE News

Sync and Summarize FE News #6

Workflow file for this run

name: Sync Fork with Upstream
on:
schedule:
- cron: '0 0 10 * *' # 매월 10일 00:00 UTC (한국시간 오전 9시)
workflow_dispatch: # 수동 실행도 가능
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout forked repo
uses: actions/checkout@v4
with:
ref: master
- name: Set up Git
run: |
git config user.name "SuKyoung Shin"
git config user.email "[email protected]"
- name: Add upstream and fetch
run: |
git remote | grep upstream || git remote add upstream https://github.com/naver/fe-news
git fetch upstream
- name: Merge upstream changes
run: |
git checkout master
git merge upstream/master --allow-unrelated-histories -m "Sync with upstream naver/fe-news"
- name: Push changes
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }} master
- name: Send Telegram Notification with Button
run: |
MONTH=$(date +'%m' | sed 's/^0*//')월
curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${{ secrets.TELEGRAM_CHAT_ID }}"'",
"text": "📮 '"${MONTH}"'의 Naver/FeNews가 방금 도착했어요!",
"reply_markup": {
"inline_keyboard": [[
{
"text": "레포 바로 가기 🔗",
"url": "https://github.com/sukyoungshin/fe-news"
}
]]
}
}'