-
Notifications
You must be signed in to change notification settings - Fork 124
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
Showing
3 changed files
with
41 additions
and
16 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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
FROM alpine | ||
|
||
LABEL "com.github.actions.name"="Git Sync Action" | ||
LABEL "com.github.actions.description"="🔃 Sync between two independent repositories" | ||
LABEL "com.github.actions.icon"="git-branch" | ||
LABEL "com.github.actions.color"="black" | ||
|
||
LABEL "repository"="http://github.com/wei/git-sync" | ||
LABEL "homepage"="http://github.com/wei/git-sync" | ||
LABEL "maintainer"="Wei He <[email protected]>" | ||
|
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 |
---|---|---|
|
@@ -24,25 +24,23 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: repo-sync | ||
uses: wei/git-sync@v1 | ||
env: | ||
SOURCE_REPO: "" | ||
SOURCE_BRANCH: "" | ||
DESTINATION_REPO: "" | ||
DESTINATION_BRANCH: "" | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
uses: wei/git-sync@v2 | ||
with: | ||
args: $SOURCE_REPO $SOURCE_BRANCH $DESTINATION_REPO $DESTINATION_BRANCH | ||
source_repo: "" | ||
source_branch: "" | ||
destination_repo: "" | ||
destination_branch: "" | ||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
``` | ||
`SSH_PRIVATE_KEY` can be omitted if using authenticated HTTPS repo clone urls like `https://username:[email protected]/username/repository.git`. | ||
`ssh_private_key` can be omitted if using authenticated HTTPS repo clone urls like `https://username:[email protected]/username/repository.git`. | ||
|
||
#### Advanced: Sync all branches | ||
|
||
To Sync all branches from source to destination, use `SOURCE_BRANCH: "refs/remotes/source/*"` and `DESTINATION_BRANCH: "refs/heads/*"`. But be careful, branches with the same name including `master` will be overwritten. | ||
To Sync all branches from source to destination, use `source_branch: "refs/remotes/source/*"` and `destination_branch: "refs/heads/*"`. But be careful, branches with the same name including `master` will be overwritten. | ||
|
||
#### Advanced: Sync all tags | ||
|
||
To Sync all tags from source to destination, use `SOURCE_BRANCH: "refs/tags/*"` and `DESTINATION_BRANCH: "refs/tags/*"`. But be careful, tags with the same name will be overwritten. | ||
To Sync all tags from source to destination, use `source_branch: "refs/tags/*"` and `destination_branch: "refs/tags/*"`. But be careful, tags with the same name will be overwritten. | ||
|
||
### Docker | ||
``` | ||
|
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,32 @@ | ||
name: Git Sync Action | ||
author: Wei He <[email protected]> | ||
description: 🔃 Sync between two independent repositories | ||
branding: | ||
icon: 'git-branch' | ||
color: 'gray-dark' | ||
inputs: | ||
source_repo: | ||
description: GitHub repo slug or full clone url | ||
required: true | ||
source_branch: | ||
description: Branch name to sync from | ||
required: true | ||
destination_repo: | ||
description: GitHub repo slug or full clone url | ||
required: true | ||
destination_branch: | ||
description: Branch name to sync to | ||
required: true | ||
ssh_private_key: | ||
description: SSH key used to authenticate with git clone urls provided (optional if public or https clone url with authentication) | ||
required: false | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
env: | ||
SSH_PRIVATE_KEY: ${{ inputs.ssh_private_key }} | ||
args: | ||
- ${{ inputs.source_repo }} | ||
- ${{ inputs.source_branch }} | ||
- ${{ inputs.destination_repo }} | ||
- ${{ inputs.destination_branch }} |