From bd22af4045659b194922c6c5baf9c53de3cd8c17 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Tue, 23 Jul 2024 14:30:01 +1200 Subject: [PATCH 1/3] chore: update runner tags, as self-hopsted runners are not available in mattrglobal --- .github/workflows/github_clone_assurance.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github_clone_assurance.yaml b/.github/workflows/github_clone_assurance.yaml index 1043e911..5afaf0fe 100644 --- a/.github/workflows/github_clone_assurance.yaml +++ b/.github/workflows/github_clone_assurance.yaml @@ -8,9 +8,10 @@ on: jobs: MirrorRepoToMATTRAssurance: - runs-on: ["self-hosted", "engineering", "Linux", "X64"] + runs-on: ubuntu-latest permissions: contents: read + id-token: write steps: - name: mirror repo uses: mattrinternal/sre-reusable-action/actions/github-clone-assurance@master From 6fd262977880ccd299e78c73472a1b3251018b26 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 24 Jul 2024 13:47:53 +1200 Subject: [PATCH 2/3] chore: use script directly instead of reusable action --- .github/workflows/github_clone_assurance.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github_clone_assurance.yaml b/.github/workflows/github_clone_assurance.yaml index 5afaf0fe..b4475e98 100644 --- a/.github/workflows/github_clone_assurance.yaml +++ b/.github/workflows/github_clone_assurance.yaml @@ -14,11 +14,14 @@ jobs: id-token: write steps: - name: mirror repo - uses: mattrinternal/sre-reusable-action/actions/github-clone-assurance@master - with: - github_repository: ${{ env.GITHUB_REPOSITORY }} - github_ref_name: ${{ env.GITHUB_REF_NAME }} - remote_git_user_name: ${{ secrets.MATTRASSURANCE_GIT_USER_NAME }} - remote_git_user_email: ${{ secrets.MATTRASSURANCE_GIT_USER_EMAIL }} - remote_git_user_pat: ${{ secrets.MATTRASSURANCE_GIT_USER_PAT }} - remote_git_repo: 'mattrassurance/pairing_crypto' + shell: bash + run: | + rm -r .git + rm -r .github + git init --initial-branch=${{ env.GITHUB_REF_NAME }} + git config --local user.name ${{ secrets.MATTRASSURANCE_GIT_USER_NAME }} + git config --local user.email ${{ secrets.MATTRASSURANCE_GIT_USER_EMAIL }} + git add . + git commit -m "Backing up ${{ env.GITHUB_REPOSITORY }} to mattrassurance org" + git remote add origin https://${{ secrets.MATTRASSURANCE_GIT_USER_NAME }}:${{ secrets.MATTRASSURANCE_GIT_USER_PAT }}@github.com/mattrassurance/pairing_crypto.git + git push origin ${{ env.GITHUB_REF_NAME }} --force From 4745dea968d4189b93058e28bc167fa6c7650611 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 24 Jul 2024 15:39:28 +1200 Subject: [PATCH 3/3] chore: add checkout step to assurance workflow --- .github/workflows/github_clone_assurance.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/github_clone_assurance.yaml b/.github/workflows/github_clone_assurance.yaml index b4475e98..68aa1e9f 100644 --- a/.github/workflows/github_clone_assurance.yaml +++ b/.github/workflows/github_clone_assurance.yaml @@ -13,6 +13,9 @@ jobs: contents: read id-token: write steps: + - name: Checkout + uses: actions/checkout@v4 + - name: mirror repo shell: bash run: |