From a111a0fc0357d4ff47e0781de5a9402a57dbf6ed Mon Sep 17 00:00:00 2001 From: Anastasiia Pokasova Date: Fri, 19 Jul 2024 12:59:24 +0300 Subject: [PATCH 1/6] Add draft for repo mirroring --- .github/workflows/mirror-repo.yml | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/mirror-repo.yml diff --git a/.github/workflows/mirror-repo.yml b/.github/workflows/mirror-repo.yml new file mode 100644 index 0000000000..d40140006c --- /dev/null +++ b/.github/workflows/mirror-repo.yml @@ -0,0 +1,84 @@ +name: Mirror repo + +on: + workflow_call: + inputs: + GITLAB_URL: + required: true + type: string + secrets: + GITLAB_USER: + required: true + GITLAB_PASSWORD: + required: true + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - id: mirror-1 + uses: yesolutions/mirror-action@master + continue-on-error: true + with: + REMOTE: ${{ inputs.GITLAB_URL }} + GIT_USERNAME: ${{ secrets.GITLAB_USER }} + GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + + - run: sleep 60s + shell: bash + if: ${{ steps.mirror-1.outcome == 'failure' }} + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + if: ${{ steps.mirror-1.outcome == 'failure' }} + - run: sudo git remote remove mirror || true + if: ${{ steps.mirror-1.outcome == 'failure' }} + - id: mirror-2 + uses: yesolutions/mirror-action@master + continue-on-error: true + with: + REMOTE: ${{ inputs.GITLAB_URL }} + GIT_USERNAME: ${{ secrets.GITLAB_USER }} + GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + if: ${{ steps.mirror-1.outcome == 'failure' }} + + - run: sleep 60s + shell: bash + if: ${{ steps.mirror-2.outcome == 'failure' }} + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + if: ${{ steps.mirror-2.outcome == 'failure' }} + - run: sudo git remote remove mirror || true + if: ${{ steps.mirror-2.outcome == 'failure' }} + - id: mirror-3 + uses: yesolutions/mirror-action@master + continue-on-error: true + with: + REMOTE: ${{ inputs.GITLAB_URL }} + GIT_USERNAME: ${{ secrets.GITLAB_USER }} + GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + if: ${{ steps.mirror-2.outcome == 'failure' }} + + - run: sleep 60s + shell: bash + if: ${{ steps.mirror-3.outcome == 'failure' }} + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + if: ${{ steps.mirror-3.outcome == 'failure' }} + - run: sudo git remote remove mirror || true + if: ${{ steps.mirror-3.outcome == 'failure' }} + - id: mirror-4 + uses: yesolutions/mirror-action@master + with: + REMOTE: ${{ inputs.GITLAB_URL }} + GIT_USERNAME: ${{ secrets.GITLAB_USER }} + GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} + if: ${{ steps.mirror-3.outcome == 'failure' }} From e4df72b8e0906eb1d35c7828105bc7649c3442cd Mon Sep 17 00:00:00 2001 From: Anastasiia Pokasova Date: Fri, 19 Jul 2024 13:02:31 +0300 Subject: [PATCH 2/6] Create mirror_repo_to_gitlab.yml --- .github/workflows/mirror_repo_to_gitlab.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/mirror_repo_to_gitlab.yml diff --git a/.github/workflows/mirror_repo_to_gitlab.yml b/.github/workflows/mirror_repo_to_gitlab.yml new file mode 100644 index 0000000000..0e3c5ad699 --- /dev/null +++ b/.github/workflows/mirror_repo_to_gitlab.yml @@ -0,0 +1,11 @@ +name: Mirror repo to GitLab + +on: [push, delete] + +jobs: + call-dream-ops-mirror-workflow: + uses: dream/.github/workflows/mirror-repo.yml@main + secrets: + GITLAB_URL: ${{ secrets.GITLAB_URL }} + GITLAB_USER: ${{ secrets.GITLAB_USER }} + GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} From 60ae67f75879268080b76c11be27b6f57ad7045e Mon Sep 17 00:00:00 2001 From: Anastasiia Pokasova Date: Fri, 19 Jul 2024 14:38:46 +0300 Subject: [PATCH 3/6] Update mirror_repo_to_gitlab.yml --- .github/workflows/mirror_repo_to_gitlab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror_repo_to_gitlab.yml b/.github/workflows/mirror_repo_to_gitlab.yml index 0e3c5ad699..9638b6cb0f 100644 --- a/.github/workflows/mirror_repo_to_gitlab.yml +++ b/.github/workflows/mirror_repo_to_gitlab.yml @@ -4,7 +4,7 @@ on: [push, delete] jobs: call-dream-ops-mirror-workflow: - uses: dream/.github/workflows/mirror-repo.yml@main + uses: .github/workflows/mirror-repo.yml@main secrets: GITLAB_URL: ${{ secrets.GITLAB_URL }} GITLAB_USER: ${{ secrets.GITLAB_USER }} From 3b8e4231637abc48127b22e3a3f1ca5706994e9d Mon Sep 17 00:00:00 2001 From: Anastasiia Pokasova Date: Fri, 19 Jul 2024 14:44:38 +0300 Subject: [PATCH 4/6] Update mirror_repo_to_gitlab.yml --- .github/workflows/mirror_repo_to_gitlab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror_repo_to_gitlab.yml b/.github/workflows/mirror_repo_to_gitlab.yml index 9638b6cb0f..f5e7fc4784 100644 --- a/.github/workflows/mirror_repo_to_gitlab.yml +++ b/.github/workflows/mirror_repo_to_gitlab.yml @@ -4,7 +4,7 @@ on: [push, delete] jobs: call-dream-ops-mirror-workflow: - uses: .github/workflows/mirror-repo.yml@main + uses: ./.github/workflows/mirror-repo.yml secrets: GITLAB_URL: ${{ secrets.GITLAB_URL }} GITLAB_USER: ${{ secrets.GITLAB_USER }} From 4d49d68b988d30ed929407cacea83d5563b2bf8e Mon Sep 17 00:00:00 2001 From: Anastasiia Pokasova Date: Fri, 19 Jul 2024 14:50:44 +0300 Subject: [PATCH 5/6] Update mirror-repo.yml --- .github/workflows/mirror-repo.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mirror-repo.yml b/.github/workflows/mirror-repo.yml index d40140006c..8bfc7c9831 100644 --- a/.github/workflows/mirror-repo.yml +++ b/.github/workflows/mirror-repo.yml @@ -23,7 +23,7 @@ jobs: uses: yesolutions/mirror-action@master continue-on-error: true with: - REMOTE: ${{ inputs.GITLAB_URL }} + REMOTE: ${{ secrets.GITLAB_URL }} GIT_USERNAME: ${{ secrets.GITLAB_USER }} GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} @@ -41,7 +41,7 @@ jobs: uses: yesolutions/mirror-action@master continue-on-error: true with: - REMOTE: ${{ inputs.GITLAB_URL }} + REMOTE: ${{ secrets.GITLAB_URL }} GIT_USERNAME: ${{ secrets.GITLAB_USER }} GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} if: ${{ steps.mirror-1.outcome == 'failure' }} @@ -60,7 +60,7 @@ jobs: uses: yesolutions/mirror-action@master continue-on-error: true with: - REMOTE: ${{ inputs.GITLAB_URL }} + REMOTE: ${{ secrets.GITLAB_URL }} GIT_USERNAME: ${{ secrets.GITLAB_USER }} GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} if: ${{ steps.mirror-2.outcome == 'failure' }} @@ -78,7 +78,7 @@ jobs: - id: mirror-4 uses: yesolutions/mirror-action@master with: - REMOTE: ${{ inputs.GITLAB_URL }} + REMOTE: ${{ secrets.GITLAB_URL }} GIT_USERNAME: ${{ secrets.GITLAB_USER }} GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} if: ${{ steps.mirror-3.outcome == 'failure' }} From 3aee069f5b5327e731d311c7c80807bc22f4265d Mon Sep 17 00:00:00 2001 From: Anastasiia Pokasova Date: Fri, 19 Jul 2024 15:00:00 +0300 Subject: [PATCH 6/6] Update mirror-repo.yml --- .github/workflows/mirror-repo.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/mirror-repo.yml b/.github/workflows/mirror-repo.yml index 8bfc7c9831..ae1511275d 100644 --- a/.github/workflows/mirror-repo.yml +++ b/.github/workflows/mirror-repo.yml @@ -2,11 +2,9 @@ name: Mirror repo on: workflow_call: - inputs: + secrets: GITLAB_URL: required: true - type: string - secrets: GITLAB_USER: required: true GITLAB_PASSWORD: