Skip to content
This repository was archived by the owner on Aug 16, 2026. It is now read-only.

Commit 517647f

Browse files
committed
new attempt at GH automation
1 parent bb352e6 commit 517647f

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/sync-mainui.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Sync MainUI copies
2+
3+
on:
4+
push:
5+
paths:
6+
- "miyoo/MainUI"
7+
- "miyoo285/MainUI"
8+
- "miyoo354/MainUI"
9+
10+
jobs:
11+
sync:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Determine modified MainUI file and sync
21+
run: |
22+
# Detect which copy changed in this commit
23+
if git diff --name-only HEAD^ HEAD | grep -q '^miyoo285/MainUI$'; then
24+
SRC="miyoo285/MainUI"
25+
elif git diff --name-only HEAD^ HEAD | grep -q '^miyoo354/MainUI$'; then
26+
SRC="miyoo354/MainUI"
27+
elif git diff --name-only HEAD^ HEAD | grep -q '^miyoo/MainUI$'; then
28+
SRC="miyoo/MainUI"
29+
else
30+
echo "No MainUI changes detected"
31+
exit 0
32+
fi
33+
34+
echo "Source of truth is: $SRC"
35+
36+
# Copy to the other two locations
37+
for DEST in miyoo/MainUI miyoo285/MainUI miyoo354/MainUI; do
38+
if [ "$DEST" != "$SRC" ]; then
39+
echo "Syncing $SRC → $DEST"
40+
cp "$SRC" "$DEST"
41+
fi
42+
done
43+
44+
- name: Commit and push if changes exist
45+
run: |
46+
if [ -n "$(git status --porcelain)" ]; then
47+
git config user.name "github-actions"
48+
git config user.email "github-actions@github.com"
49+
git add .
50+
git commit -m "Sync MainUI copies"
51+
git push
52+
else
53+
echo "No changes to commit"
54+
fi

0 commit comments

Comments
 (0)