From f6ca6742a4cb55d5cdcd3d9c8c1a63d0b90f4ccb Mon Sep 17 00:00:00 2001 From: "Mallya, Ameya Keshava" Date: Tue, 19 Nov 2024 08:16:40 -0800 Subject: [PATCH] Create force-sync.yml --- .github/workflows/force-sync.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/force-sync.yml diff --git a/.github/workflows/force-sync.yml b/.github/workflows/force-sync.yml new file mode 100644 index 0000000000..70a039bc50 --- /dev/null +++ b/.github/workflows/force-sync.yml @@ -0,0 +1,30 @@ +name: Sync Repo + +on: + workflow_dispatch: + +jobs: + build: + runs-on: self-hosted + steps: + - name: Mirror the repository + env: + SOURCE_REPO: 'https://github.com/ROCm/rocprofiler-sdk-internal.git' + TARGET_REPO: 'https://github.com/AMD-ROCm-Internal/ameya-sdk-test' + SOURCE_ACCESS_TOKEN: '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' + TARGET_ACCESS_TOKEN: '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' + run: | + sudo rm -rf source-repo + + # Clone the source repository using the PAT in the URL + + SOURCE_REPO_WITH_CREDENTIALS="https://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@github.com/ROCm/rocprofiler-sdk-internal.git" + git clone --mirror "$SOURCE_REPO_WITH_CREDENTIALS" source-repo + cd source-repo + + # Set the push URL to the target repository with the PAT in the URL + TARGET_REPO_WITH_CREDENTIALS="https://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@github.com/AMD-ROCm-Internal/ameya-sdk-test.git" + git remote set-url --push origin "$TARGET_REPO_WITH_CREDENTIALS" + + # Push the changes using --mirror + git push --mirror