Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add force option to mirror action #1801

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading