From b0b7c923bbc67d00ad388115ab33ab2175bce26f Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 28 Mar 2025 13:15:01 -0400 Subject: [PATCH 1/4] feat: sync private repo --- .github/workflows/sync-mirror.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/sync-mirror.yml diff --git a/.github/workflows/sync-mirror.yml b/.github/workflows/sync-mirror.yml new file mode 100644 index 0000000000..02178ce4e9 --- /dev/null +++ b/.github/workflows/sync-mirror.yml @@ -0,0 +1,24 @@ +name: Sync Mirror + +on: + push: + branches: [ main ] + workflow_dispatch: + # TODO: REMOVE v + pull_request: + branches: [ main ] + # TODO: REMOVE ^ + +jobs: + git-sync: + if: github.repository == 'smithy-lang/smithy-kotlin' + runs-on: ubuntu-latest + steps: + - name: git-sync + uses: wei/git-sync@v3 + with: + source_repo: "smithy-lang/smithy-kotlin" + source_branch: "main" + destination_repo: ${{ secrets.GIT_SYNC_DESTINATION_REPO }} + destination_branch: "main" + # destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }} \ No newline at end of file From 3158c23982eab2effd44093505b0ad6227715c43 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 28 Mar 2025 14:15:02 -0400 Subject: [PATCH 2/4] fix: include credentials --- .github/workflows/sync-mirror.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-mirror.yml b/.github/workflows/sync-mirror.yml index 02178ce4e9..4a798042fa 100644 --- a/.github/workflows/sync-mirror.yml +++ b/.github/workflows/sync-mirror.yml @@ -17,8 +17,7 @@ jobs: - name: git-sync uses: wei/git-sync@v3 with: - source_repo: "smithy-lang/smithy-kotlin" + source_repo: "https://${{ secrets.CI_USER }}:${{ secrets.CI_USER_PAT }}@github.com/smithy-lang/smithy-kotlin.git" source_branch: "main" - destination_repo: ${{ secrets.GIT_SYNC_DESTINATION_REPO }} - destination_branch: "main" - # destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }} \ No newline at end of file + destination_repo: "https://${{ secrets.CI_USER }}:${{ secrets.CI_USER_PAT }}@github.com/${{ secrets.GIT_SYNC_DESTINATION_REPO }}.git" + destination_branch: "main" \ No newline at end of file From 9f95f91d24efc20c16629ef686d5436f4515cef7 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 28 Mar 2025 14:26:41 -0400 Subject: [PATCH 3/4] misc: get ready for review --- .github/workflows/sync-mirror.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/sync-mirror.yml b/.github/workflows/sync-mirror.yml index 4a798042fa..37d9669ed9 100644 --- a/.github/workflows/sync-mirror.yml +++ b/.github/workflows/sync-mirror.yml @@ -4,10 +4,6 @@ on: push: branches: [ main ] workflow_dispatch: - # TODO: REMOVE v - pull_request: - branches: [ main ] - # TODO: REMOVE ^ jobs: git-sync: From 5656a3eda4adbb0836df8bfcb6b7c7be93e189d8 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 28 Mar 2025 15:45:51 -0400 Subject: [PATCH 4/4] fix: get rid of secrets --- .github/workflows/sync-mirror.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-mirror.yml b/.github/workflows/sync-mirror.yml index 37d9669ed9..edc80ce30c 100644 --- a/.github/workflows/sync-mirror.yml +++ b/.github/workflows/sync-mirror.yml @@ -7,13 +7,14 @@ on: jobs: git-sync: + # Only sync when pushing to source repo if: github.repository == 'smithy-lang/smithy-kotlin' runs-on: ubuntu-latest steps: - name: git-sync uses: wei/git-sync@v3 with: - source_repo: "https://${{ secrets.CI_USER }}:${{ secrets.CI_USER_PAT }}@github.com/smithy-lang/smithy-kotlin.git" + source_repo: "https://aws-sdk-kotlin-ci:${{ secrets.CI_USER_PAT }}@github.com/smithy-lang/smithy-kotlin.git" source_branch: "main" - destination_repo: "https://${{ secrets.CI_USER }}:${{ secrets.CI_USER_PAT }}@github.com/${{ secrets.GIT_SYNC_DESTINATION_REPO }}.git" + destination_repo: "https://aws-sdk-kotlin-ci:${{ secrets.CI_USER_PAT }}@github.com/smithy-lang/private-smithy-kotlin-staging.git" destination_branch: "main" \ No newline at end of file