From a98b073ae2b993892641bb1eb6ce707cc673d9ad Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 18 Jun 2020 22:20:36 +0200 Subject: [PATCH] fixup! Mirror master and main The workflow needs to be adjusted so that the just-pushed branch is cloned (otherwise it is always the default branch that is cloned, even if in the case that branch is stale). Signed-off-by: Johannes Schindelin --- .github/workflows/mirror-master-and-main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mirror-master-and-main.yml b/.github/workflows/mirror-master-and-main.yml index fbcb74a3b0ed70..8516479b1db41b 100644 --- a/.github/workflows/mirror-master-and-main.yml +++ b/.github/workflows/mirror-master-and-main.yml @@ -10,7 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Partial clone - run: git clone --bare --depth=100 --single-branch --filter=blob:none ${{ github.event.repository.html_url }} . + 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)"