From 7c02e2c34ec9fd4a971dc8888751dfdcb6906b80 Mon Sep 17 00:00:00 2001 From: Rusab Khan Date: Fri, 26 Jan 2024 23:31:28 +0500 Subject: [PATCH] artifact --- .github/workflows/download_and_sync_repo.yml | 29 ++++++++++++++++++++ .github/workflows/sync.yml | 28 ++++++------------- 2 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/download_and_sync_repo.yml diff --git a/.github/workflows/download_and_sync_repo.yml b/.github/workflows/download_and_sync_repo.yml new file mode 100644 index 0000000..32c493f --- /dev/null +++ b/.github/workflows/download_and_sync_repo.yml @@ -0,0 +1,29 @@ +on: + workflow_run: + workflows: ["Sync Repositories"] + types: + - completed + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Download Repository Artifact + uses: actions/download-artifact@v2 + with: + name: repository-artifact + + - name: Checkout Target Repository + uses: actions/checkout@v2 + + - name: Sync Changes + run: | + cp -r ${{ github.workspace }}/repository-artifact/* . + + - name: Commit and Push Changes + run: | + git add . + git commit -m "Sync changes from source repository" + git push + \ No newline at end of file diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 4166d63..ecacea0 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,4 +1,4 @@ -name: Sync to OpenETL Pro +name: Sync Repositories on: push: @@ -10,22 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out OpenETL Pro repository - uses: actions/checkout@v2 - with: - repository: RusabKhan/OpenETL-Pro - path: OpenETL-Pro - refs: actions + - name: Checkout Source Repository + uses: actions/checkout@v2 - - name: Push changes to develop branch of OpenETL Pro - run: | - cd OpenETL-Pro - git config --global user.email "rusabkhan7@gmail.com" - git config --global user.name "Rusab Khan" - git checkout develop - git pull origin develop - cp -R ../. . - - git add . - git commit -m "Sync changes from main branch of OpenETL" - git push origin develop + - name: Upload Repository as Artifact + uses: actions/upload-artifact@v2 + with: + name: repository-artifact + path: . # Upload the entire repository + \ No newline at end of file