From ff4fc45b74ab2185cdd7628b06995fb1cf362df8 Mon Sep 17 00:00:00 2001 From: cato <47259183+cato447@users.noreply.github.com> Date: Sun, 5 Jun 2022 17:15:05 +0200 Subject: [PATCH 1/4] Added branch name to push instruction --- .github/workflows/bitbucket-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bitbucket-sync.yml b/.github/workflows/bitbucket-sync.yml index 167c20b..090c997 100644 --- a/.github/workflows/bitbucket-sync.yml +++ b/.github/workflows/bitbucket-sync.yml @@ -54,4 +54,4 @@ jobs: run: git pull --rebase upstream main - name: Git push to other repo - run: git push upstream + run: git push upstream HEAD:main From 5afb30093490465e1d1c3727dac532bbac8fdb45 Mon Sep 17 00:00:00 2001 From: cato <47259183+cato447@users.noreply.github.com> Date: Sun, 5 Jun 2022 17:17:40 +0200 Subject: [PATCH 2/4] Update bitbucket-sync.yml --- .github/workflows/bitbucket-sync.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/bitbucket-sync.yml b/.github/workflows/bitbucket-sync.yml index 090c997..3b3aa64 100644 --- a/.github/workflows/bitbucket-sync.yml +++ b/.github/workflows/bitbucket-sync.yml @@ -7,8 +7,6 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] - pull_request: - branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From dadc8d17974c34ea108702a74ce0c27e75b97cfa Mon Sep 17 00:00:00 2001 From: cato <47259183+cato447@users.noreply.github.com> Date: Sun, 5 Jun 2022 17:18:03 +0200 Subject: [PATCH 3/4] Update bitbucket-sync.yml --- .github/workflows/bitbucket-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bitbucket-sync.yml b/.github/workflows/bitbucket-sync.yml index 3b3aa64..fdc52fd 100644 --- a/.github/workflows/bitbucket-sync.yml +++ b/.github/workflows/bitbucket-sync.yml @@ -52,4 +52,4 @@ jobs: run: git pull --rebase upstream main - name: Git push to other repo - run: git push upstream HEAD:main + run: git push upstream From f6e1373a46189a2e7220d3415d05e837d5ae19e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Bu=C3=9Fmann?= Date: Sun, 5 Jun 2022 17:24:08 +0200 Subject: [PATCH 4/4] added sync test action --- .github/workflows/bitbucket-sync-test.yml | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/bitbucket-sync-test.yml diff --git a/.github/workflows/bitbucket-sync-test.yml b/.github/workflows/bitbucket-sync-test.yml new file mode 100644 index 0000000..598d458 --- /dev/null +++ b/.github/workflows/bitbucket-sync-test.yml @@ -0,0 +1,53 @@ +# This is a basic workflow to help you get started with Actions + +name: Test sync to bitbucket + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + env: + UPSTREAM: ssh://git@bitbucket.ase.in.tum.de:7999/EIST22T02/eist22t02-whattocool48.git + BITBUCKET_PUB_KEY: "[bitbucket.ase.in.tum.de]:7999,[131.159.89.140]:7999 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCO2i69e5LJibEDwVrwG9edX+xqeRB/Do+C8dNclgB5lFJjA5MlTFAZ4WewbLBeGXGAc5O64ckBlI82+FI1GwIkiKRoi/9qe+NGLmZFsjBRSz2fHLfKo/iEa8ytPP9E4iql1u7Rl+pnmY2claJ+ABQOt4XQgLWjYcIBHWpwhQ9tRjg73zUI/n/PKyEnODR14bEzJ/fBmTMgnm1ZdtSPViqLmByXgjgorCWPsRA3DrPsH3A9ncietUPj/qRbsWsPhiKK1yXXaKDHDgRD7ennVrwCAYG2hhTZEbZcjE8bbe9UY9WrRtoWLFKB/xDTn7pRv+ZxqXlcoP224we7J9s2ke1H" + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Set up remote + run: git remote add upstream ${{env.UPSTREAM}} + + - name: Setup SSH Agent + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: | + ${{ secrets.PRIVATE_KEY }} + + - name: Copy ssh public_key + run: echo "${{SECRETS.PUBLIC_KEY}}" > ~/.ssh/id_rsa.pub + + - name: Add bitbucket to known SSH-HOST + run: echo ${{env.BITBUCKET_PUB_KEY}} >> ~/.ssh/known_hosts + + - name: Pull origin + run: git fetch --unshallow + + - name: Specify Identity in case of rebasing + run: git config --global user.email "organisation-name@github.com" && git config --global user.name "GitHub Action Runner" + + - name: Fix merge conflicts if any + run: git pull --rebase upstream main +