-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (39 loc) · 1.36 KB
/
sync-docs.yml
File metadata and controls
43 lines (39 loc) · 1.36 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
name: Sync docs to bugdrop-web
on:
push:
branches: [main]
paths:
- 'docs/website/**'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout bugdrop
uses: actions/checkout@v4
- name: Checkout bugdrop-web
uses: actions/checkout@v4
with:
repository: mean-weasel/bugdrop-web
path: bugdrop-web
token: ${{ secrets.BUGDROP_WEB_TOKEN }}
- name: Sync docs and create PR
env:
GH_TOKEN: ${{ secrets.BUGDROP_WEB_TOKEN }}
run: |
cp docs/website/*.mdx bugdrop-web/src/content/docs/
cd bugdrop-web
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src/content/docs/
if git diff --cached --quiet; then
echo "No documentation changes to sync"
else
BRANCH="docs/sync-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
git commit -m "docs: sync documentation from bugdrop repo"
git push -u origin "$BRANCH"
gh pr create --repo mean-weasel/bugdrop-web \
--title "docs: sync documentation from bugdrop repo" \
--body "Automated sync of docs/website/*.mdx from mean-weasel/bugdrop." \
--base main --head "$BRANCH"
fi