-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (28 loc) · 1.01 KB
/
sync-readme.yml
File metadata and controls
35 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Sync README
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
sync-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout my repo
uses: actions/checkout@v4
# ⚠️ persist-credentials 생략 → 기본값 true → GITHUB_TOKEN 사용됨
- name: Download upstream README
run: |
curl -L https://raw.githubusercontent.com/SSAFY-Gumi4-Algorithm-Study/.github/main/profile/README.md \
-o upstream_README.md
- name: Update README if changed
run: |
if [ ! -f README.md ] || ! cmp -s README.md upstream_README.md; then
mv upstream_README.md README.md
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "README 자동 동기화" || echo "No changes to commit"
git push
else
echo "README is already up to date."
fi