forked from wearerequired/git-mirror-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
30 lines (30 loc) · 1.18 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: 'Mirror a repository using SSH'
description: 'Action for mirroring a repository in another location (Bitbucket, GitHub, GitLab, …) using SSH.'
branding:
icon: 'copy'
color: 'orange'
inputs:
source-repo:
description: 'SSH URL of the source repo.'
required: true
destination-repo:
description: 'SSH URL of the destination repo.'
required: true
ssh-private-key:
description: 'SSH key for authentication.'
required: true
github-token:
description: 'GitHub token for pulling internal docker container (container is public so any token will do).'
default: ${{ github.token }}
runs:
using: "composite"
steps:
- name: Authenticate
run: echo ${{ inputs.github-token }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
shell: bash
- name: Pull Image
run: docker pull "docker.pkg.github.com/mavenoid/git-mirror-action/git-mirror-action:2.2.0"
shell: bash
- name: Git Mirror
run: docker run --rm -e "SSH_PRIVATE_KEY=${{ inputs.ssh-private-key }}" "docker.pkg.github.com/mavenoid/git-mirror-action/git-mirror-action:2.2.0" "${{ inputs.source-repo }}" "${{ inputs.destination-repo }}"
shell: bash