Skip to content

Commit

Permalink
Add force option to mirror action
Browse files Browse the repository at this point in the history
Add manual option to force push changes from github to git.mysociety.org
  • Loading branch information
ajparsons committed Jun 21, 2024
1 parent 714afc7 commit 57a3623
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
if: ${{ github.event.inputs.force_push == 'false' || !github.event.inputs.force_push }}
uses: mysociety/[email protected]
with:
git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }}
ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }}
tag: ${{ github.ref_name }}
remote: 'ssh://[email protected]/data/git/public/theyworkforyou.git'


- name: Push branch to git.mysociety.org (force)
id: push_to_mirror_force
if: ${{ github.event.inputs.force_push == 'true' }}
uses: mysociety/[email protected]
with:
git_ssh_key: ${{ secrets.PUBLICCVS_GIT_KEY }}
ssh_known_hosts: ${{ secrets.GIT_KNOWN_HOSTS }}
tag: ${{ github.ref_name }}
remote: 'ssh://[email protected]/data/git/public/theyworkforyou.git'
extra_git_config: --force

0 comments on commit 57a3623

Please sign in to comment.