Skip to content

Commit b20e176

Browse files
2 parents daa7bc4 + 93444fe commit b20e176

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/sync-repos.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Sync SamplesByPlatforms to Private Repo
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'Src/SamplesByPlatforms/**'
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout source repo
14+
uses: actions/checkout@v3
15+
with:
16+
path: source
17+
18+
- name: Checkout target repo
19+
uses: actions/checkout@v3
20+
with:
21+
repository: xceedsoftware/xceed-zip-samplesbyplatforms
22+
token: ${{ secrets.PRIVATE_REPO_PAT }}
23+
path: target
24+
25+
- name: Copy files
26+
run: |
27+
rm -rf target/*
28+
cp -r source/Src/SamplesByPlatforms/* target/
29+
30+
- name: Commit and push changes
31+
run: |
32+
cd target
33+
git config user.name "GitHub Action"
34+
git config user.email "[email protected]"
35+
git add .
36+
git diff --quiet && git diff --staged --quiet || git commit -m "Sync from public repo: ${{ github.event.after }}"
37+
git push

0 commit comments

Comments
 (0)