From fac0b1accefb7850cc266212fcb2eff306e1874a Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Tue, 1 Oct 2024 20:32:39 +0000 Subject: [PATCH] Update mirror action (allow force push) --- .github/workflows/mirror.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 2c5f554a..f5a5d0cf 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -3,6 +3,11 @@ name: Push mirror to git.mysociety.org on: push: workflow_dispatch: + inputs: + force_push: + description: 'Force push branch' + type: boolean + required: false jobs: sync: @@ -11,15 +16,28 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: '0' - name: Push branch to git.mysociety.org id: push_to_mirror - uses: mysociety/action-git-pusher@v1.1.1 + if: ${{ github.event.inputs.force_push == 'false' || !github.event.inputs.force_push }} + uses: mysociety/action-git-pusher@v1.2.0 with: git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }} ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }} tag: ${{ github.ref_name }} - remote: 'ssh://gh-public@git.mysociety.org/data/git/public/parlparse.git' \ No newline at end of file + remote: 'ssh://gh-public@git.mysociety.org/data/git/public/parlparse.git' + + + - name: Push branch to git.mysociety.org (force) + id: push_to_mirror_force + if: ${{ github.event.inputs.force_push == 'true' }} + uses: mysociety/action-git-pusher@v1.2.0 + with: + git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }} + ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }} + tag: ${{ github.ref_name }} + remote: 'ssh://gh-public@git.mysociety.org/data/git/public/parlparse.git' + extra_git_config: --force \ No newline at end of file