diff --git a/.github/workflows/sync-to-python.yml b/.github/workflows/sync-to-python.yml new file mode 100644 index 0000000..4a53ae3 --- /dev/null +++ b/.github/workflows/sync-to-python.yml @@ -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 \ No newline at end of file diff --git a/.project b/.project new file mode 100644 index 0000000..2d2d9ad --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + RepoSyncTestJava + + + + + + + + diff --git a/sync_folder/test.txt b/sync_folder/test.txt new file mode 100644 index 0000000..aef26c2 --- /dev/null +++ b/sync_folder/test.txt @@ -0,0 +1 @@ +This is atest foile for testing synchronisation bewteen Java and Pyhton repositories. \ No newline at end of file