-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d8b4710
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM alpine:3.11 | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<p align="center"> | ||
<a href="https://github.com/net-engine/github-action-repository-sync"><img alt="typescript-action status" src="https://github.com/net-engine/github-action-repository-sync/workflows/build-test/badge.svg"></a> | ||
</p> | ||
|
||
# Git Repository Sync Action | ||
|
||
A [GitHub action](https://github.com/features/actions) to push changes to a branch in a current GitHub repository to any remote repository, i.e. another GitHub, GitLab, AWS CodeCommit repository. | ||
|
||
Inspired by the following actions | ||
|
||
* [wei/git-sync](https://github.com/wei/git-sync) | ||
* [pixta-dev/repository-mirroring-action](https://github.com/pixta-dev/repository-mirroring-action) | ||
|
||
## Inputs | ||
|
||
### `who-to-greet` | ||
|
||
**Required** The name of the person to greet. Default `"World"`. | ||
|
||
|
||
## Example usage | ||
|
||
uses: actions/hello-world-docker-action@v1 | ||
with: | ||
who-to-greet: 'Mona the Octocat' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Git Repository Sync | ||
description: Sync current repository to a remote repository on GitHub, GitLab, AWS CodeCommit, etc. | ||
author: NetEngine | ||
inputs: | ||
ssh_private_key: | ||
description: SSH private key for ssh connection to the target repository | ||
required: false | ||
source_branch: | ||
description: The branch from this repository that you want to push to the remote | ||
required: false | ||
default: master | ||
target_branch: | ||
description: The branch from the remote repository that you want to push the source_branch to | ||
required: false | ||
default: master | ||
target_repo_url: | ||
description: Target git repository URL | ||
required: true | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.ssh_private_key }} | ||
- ${{ inputs.source_branch }} | ||
- ${{ inputs.target_branch }} | ||
- ${{ inputs.target_repo_url }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh -l | ||
|
||
# Setup SSH | ||
mkdir ~/.ssh | ||
echo "$INPUT_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
|
||
git remote add destination "$INPUT_TARGET_REPO_URL" | ||
git push destination "$INPUT_SOURCE_BRANCH:$INPUT_TARGET_BRANCH" -f |