Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ inputs:
destination_ssh_private_key:
description: SSH key used to authenticate with destination ssh url provided (optional if public or https url with authentication)
required: false
update_head:
description: Update HEAD reference
required: false
runs:
using: 'docker'
image: 'Dockerfile'
env:
SSH_PRIVATE_KEY: ${{ inputs.ssh_private_key }}
SOURCE_SSH_PRIVATE_KEY: ${{ inputs.source_ssh_private_key }}
DESTINATION_SSH_PRIVATE_KEY: ${{ inputs.destination_ssh_private_key }}
UPDATE_HEAD: ${{ inputs.update_head }}
args:
- ${{ inputs.source_repo }}
- ${{ inputs.source_branch }}
Expand Down
6 changes: 5 additions & 1 deletion git-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ fi
git remote add destination "$DESTINATION_REPO"

# Pull all branches references down locally so subsequent commands can see them
git fetch source '+refs/heads/*:refs/heads/*' --update-head-ok
if [[ -n "$UPDATE_HEAD" && "$UPDATE_HEAD" = true ]]; then
git fetch source '+refs/heads/*:refs/heads/*' --update-head-ok
else
git fetch source '+refs/heads/*:refs/heads/*'
fi

# Print out all branches
git --no-pager branch -a -vv
Expand Down