Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/reload/git-push-mirror-action

Push your checkout to a git mirror (git push --mirror)
https://github.com/reload/git-push-mirror-action

actions git-mirror github-actions

Last synced: 12 days ago
JSON representation

Push your checkout to a git mirror (git push --mirror)

Awesome Lists containing this project

README

        

# Push your checkout to a git mirror (git push --mirror)

This action can be used to push your checkout to a git mirror.

We use it to mirror the master branch to a BitBucket repository.

**Notice:** The action will do a `git push --mirror `. This will
delete all remote branches not known to the local (that is the
checkout done by the action) checkout. So potentially dangerous if you
mess up the checkout.

This is the workflow file we use:

```yaml
on:
push:
branches:
- master
name: Push to Bitbucket
jobs:
push_to_bitbucket:
name: Push to Bitbucket
if: "!github.event.deleted"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
with:
fetch-depth: 0 # Zero indicates all history
ref: master
- name: Push to mirror
uses: reload/git-push-mirror-action@master
with:
args: https://${{ secrets.BITBUCKET_USER }}:${{ secrets.BITBUCKET_APP_PASSWORD }}@bitbucket.org/foo/bar.git
```