-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (32 loc) · 988 Bytes
/
Copy pathsync-repos.yml
File metadata and controls
37 lines (32 loc) · 988 Bytes
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
name: Sync SamplesByPlatforms to Private Repo
on:
push:
branches: [ main, master ]
paths:
- 'Src/SamplesByPlatforms/**'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout source repo
uses: actions/checkout@v3
with:
path: source
- name: Checkout target repo
uses: actions/checkout@v3
with:
repository: xceedsoftware/xceed-words-samplesbyplatforms
token: ${{ secrets.PRIVATE_REPO_PAT }}
path: target
- name: Copy files
run: |
rm -rf target/*
cp -r source/Src/SamplesByPlatforms/* target/
- name: Commit and push changes
run: |
cd target
git config user.name "GitHub Action"
git config user.email "action@github.com"
git add .
git diff --quiet && git diff --staged --quiet || git commit -m "Sync from public repo: ${{ github.event.after }}"
git push