-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (40 loc) · 1.23 KB
/
sync-docs.yml
File metadata and controls
48 lines (40 loc) · 1.23 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
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Sync docs from trunk-recorder
on:
# Triggered by trunk-recorder when docs/** changes on master
repository_dispatch:
types: [docs-updated]
# Manual trigger via GitHub UI
workflow_dispatch:
# Daily fallback in case the dispatch was missed
schedule:
- cron: '0 4 * * *'
jobs:
sync:
name: Sync docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout site repo
uses: actions/checkout@v4
with:
path: site
- name: Checkout trunk-recorder repo
uses: actions/checkout@v4
with:
repository: TrunkRecorder/trunk-recorder
path: trunk-recorder
- name: Run sync script
run: python3 site/scripts/sync-docs.py trunk-recorder/docs site/docs
- name: Commit and push if changed
working-directory: site
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/
if git diff --staged --quiet; then
echo "No changes — nothing to commit."
else
git commit -m "chore: sync docs from trunk-recorder"
git push
fi