https://github.com/mysociety/action-git-pusher
GithHub Action to push git things somewhere else
https://github.com/mysociety/action-git-pusher
actions git
Last synced: 9 months ago
JSON representation
GithHub Action to push git things somewhere else
- Host: GitHub
- URL: https://github.com/mysociety/action-git-pusher
- Owner: mysociety
- Created: 2021-03-10T16:01:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-18T15:23:51.000Z (11 months ago)
- Last Synced: 2025-08-26T18:51:38.251Z (10 months ago)
- Topics: actions, git
- Language: Shell
- Homepage: https://www.mysociety.org/
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git Mirroring Action
**This is being tested, and is subject to change**
This simple action can be used to push git objects to a secondary
repository.
There are other actions out there that do similar things, but none that
quite meet our use-case.
Currently, this only supports pushing tags - trying to run this action
without providing a `tag` input will generate an error.
As an example where this is being used with a tagging action where you
want to ensure the tag is pushed to another remote:
```yaml
name: Bump Tag
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Bump tag
id: bump_tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
- name: Push Tag to mirror
id: push_to_mirror
uses: mysociety/action-git-pusher@v1.3.0
with:
git_ssh_key: ${{ secrets.SOME_GIT_KEY }}
ssh_known_hosts: ${{ secrets.SOME_KNOWN_HOSTS }}
tag: ${{ steps.bump_tag.outputs.new_tag }}
remote: 'ssh://username@git.example.com/path/to/repository.git'
```
To add extra flags to the git push command, you can use the `extra_git_config` input.
```yaml
- name: Test force pushing to mirror
id: push_to_mirror
uses: mysociety/action-git-pusher@v1.3.0
with:
git_ssh_key: ${{ secrets.SOME_GIT_KEY }}
ssh_known_hosts: ${{ secrets.SOME_KNOWN_HOSTS }}
tag: ${{ steps.bump_tag.outputs.new_tag }}
remote: 'ssh://username@git.example.com/path/to/repository.git'
extra_git_config: --force --dry-run
```