-
Notifications
You must be signed in to change notification settings - Fork 24
62 lines (53 loc) · 1.48 KB
/
copy-md.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Copy MD Files and Create PR
on:
workflow_dispatch:
schedule:
- cron: '0 0,12 * * *'
push:
jobs:
sync-docs-and-create-pr:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Checkout Sync-Branch
run: |
git fetch --all
git checkout sync-docs-branch
- name: Set Up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: |
yarn install --frozen-lockfile
- name: Run Sync Script
run: |
chmod +x sync_script.sh
./sync_script.sh
- uses: stefanzweifel/git-auto-commit-action@v4
if: always()
with:
commit_message: sync documentation changes
branch: sync-docs-branch
create_branch: false
file_pattern: '*.md'
disable_globbing: true
add_options: -A
run: |
git fetch --all
git checkout sync-docs-branch
- uses: actions/push@v3
with:
branches: sync-docs-branch
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
base: main
branch: sync-docs-branch
title: "Sync Documentation Changes"
body: "Automatically generated by GitHub Actions to sync documentation changes."