From e3ba7d0e536408c590b669642e5e770950698d4a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 16 Jun 2020 21:31:03 +0200 Subject: [PATCH] Mirror master and main In preparation for eventually switching over to `main`, let's synchronize the historical and the designated future main branch. This follows the excellent advice from https://github.com/chancancode/branch-rename/#gradual-migration Signed-off-by: Johannes Schindelin --- .github/workflows/mirror-master-and-main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/mirror-master-and-main.yml diff --git a/.github/workflows/mirror-master-and-main.yml b/.github/workflows/mirror-master-and-main.yml new file mode 100644 index 0000000000..8516479b1d --- /dev/null +++ b/.github/workflows/mirror-master-and-main.yml @@ -0,0 +1,19 @@ +name: Mirror "master" and "main" branches +on: + push: + branches: + - master + - main + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Partial clone + env: + ref: ${{ github.event.ref }} + run: git clone --bare --depth=100 --single-branch --branch ${ref#refs/heads/} --filter=blob:none ${{ github.event.repository.html_url }} . + - name: Push + run: | + git config http.https://github.com/.extraheader "Authorization: Basic $(echo -n x-access-token:${{ github.token }} | base64 --wrap=0)" + git push origin HEAD:master HEAD:main