Skip to content

Commit e07e85c

Browse files
authoredApr 23, 2020
feat: add v2 action.yml support (#12)
1 parent f5f2380 commit e07e85c

File tree

3 files changed

+41
-16
lines changed

3 files changed

+41
-16
lines changed
 

‎Dockerfile

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
FROM alpine
22

3-
LABEL "com.github.actions.name"="Git Sync Action"
4-
LABEL "com.github.actions.description"="🔃 Sync between two independent repositories"
5-
LABEL "com.github.actions.icon"="git-branch"
6-
LABEL "com.github.actions.color"="black"
7-
83
LABEL "repository"="http://github.com/wei/git-sync"
94
LABEL "homepage"="http://github.com/wei/git-sync"
105
LABEL "maintainer"="Wei He <github@weispot.com>"

‎README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,23 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: repo-sync
27-
uses: wei/git-sync@v1
28-
env:
29-
SOURCE_REPO: ""
30-
SOURCE_BRANCH: ""
31-
DESTINATION_REPO: ""
32-
DESTINATION_BRANCH: ""
33-
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
27+
uses: wei/git-sync@v2
3428
with:
35-
args: $SOURCE_REPO $SOURCE_BRANCH $DESTINATION_REPO $DESTINATION_BRANCH
29+
source_repo: ""
30+
source_branch: ""
31+
destination_repo: ""
32+
destination_branch: ""
33+
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
3634
```
37-
`SSH_PRIVATE_KEY` can be omitted if using authenticated HTTPS repo clone urls like `https://username:access_token@github.com/username/repository.git`.
35+
`ssh_private_key` can be omitted if using authenticated HTTPS repo clone urls like `https://username:access_token@github.com/username/repository.git`.
3836

3937
#### Advanced: Sync all branches
4038

41-
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.
39+
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.
4240

4341
#### Advanced: Sync all tags
4442

45-
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.
43+
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.
4644

4745
### Docker
4846
```

‎action.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Git Sync Action
2+
author: Wei He <github@weispot.com>
3+
description: 🔃 Sync between two independent repositories
4+
branding:
5+
icon: 'git-branch'
6+
color: 'gray-dark'
7+
inputs:
8+
source_repo:
9+
description: GitHub repo slug or full clone url
10+
required: true
11+
source_branch:
12+
description: Branch name to sync from
13+
required: true
14+
destination_repo:
15+
description: GitHub repo slug or full clone url
16+
required: true
17+
destination_branch:
18+
description: Branch name to sync to
19+
required: true
20+
ssh_private_key:
21+
description: SSH key used to authenticate with git clone urls provided (optional if public or https clone url with authentication)
22+
required: false
23+
runs:
24+
using: 'docker'
25+
image: 'Dockerfile'
26+
env:
27+
SSH_PRIVATE_KEY: ${{ inputs.ssh_private_key }}
28+
args:
29+
- ${{ inputs.source_repo }}
30+
- ${{ inputs.source_branch }}
31+
- ${{ inputs.destination_repo }}
32+
- ${{ inputs.destination_branch }}

0 commit comments

Comments
 (0)
Please sign in to comment.