Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/sync-to-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sync to Python Repo

on:
push:
paths:
- 'sync-folder/**' # Only trigger when files in sync-folder change
workflow_dispatch: # Allow manual trigger

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Java Repo
uses: actions/checkout@v4
with:
path: java-repo

- name: Checkout Python Repo
uses: actions/checkout@v4
with:
repository: YOUR_USERNAME/YOUR_PYTHON_REPO_NAME
token: ${{ secrets.SYNC_TOKEN }}
path: python-repo

- name: Sync files
run: |
# Copy files from Java repo to Python repo
mkdir -p python-repo/synced-from-java
cp -r java-repo/sync-folder/* python-repo/synced-from-java/

- name: Commit and Push to Python Repo
run: |
cd python-repo
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 Java repo [automated]"
git push
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RepoSyncTestJava</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
1 change: 1 addition & 0 deletions sync_folder/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is atest foile for testing synchronisation bewteen Java and Pyhton repositories.
Loading