Skip to content

Commit

Permalink
Mirror master and main
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jul 7, 2020
1 parent d4bdc88 commit 2657d1a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/mirror-master-and-main.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2657d1a

Please sign in to comment.