Skip to content

Commit

Permalink
Merge pull request #23 from yesolutions/remote-name
Browse files Browse the repository at this point in the history
Small improvements for remote name changes
  • Loading branch information
spyoungtech authored Mar 9, 2022
2 parents ff16376 + d7c0ae0 commit 7cc4970
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ branding:

inputs:
REMOTE_NAME:
description: "Remote name"
description: "The remote ref name to use. 'mirror' by default. Useful to avoid conflicts with existing remotes."
required: false
REMOTE:
description: "The remote repository e.g. https://github.com/octocat/foo.git or [email protected]:octocat/foo.git"
Expand Down
5 changes: 1 addition & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi

GIT_USERNAME=${INPUT_GIT_USERNAME:-${GIT_USERNAME:-"git"}}
REMOTE=${INPUT_REMOTE:-"$*"}
REMOTE_NAME=${INPUT_REMOTE_NAME}
REMOTE_NAME=${INPUT_REMOTE_NAME:-"mirror"}
GIT_SSH_PRIVATE_KEY=${INPUT_GIT_SSH_PRIVATE_KEY}
GIT_SSH_PUBLIC_KEY=${INPUT_GIT_SSH_PUBLIC_KEY}
GIT_PUSH_ARGS=${INPUT_GIT_PUSH_ARGS:-"--tags --force --prune"}
Expand Down Expand Up @@ -62,9 +62,6 @@ else
git config --global credential.helper cache
fi

if [ -z "${REMOTE_NAME}" ]; then
REMOTE_NAME=mirror
fi
git remote add ${REMOTE_NAME} "${REMOTE}"
if [[ "${INPUT_PUSH_ALL_REFS}" != "false" ]]; then
eval git push ${GIT_PUSH_ARGS} ${REMOTE_NAME} "\"refs/remotes/origin/*:refs/heads/*\""
Expand Down

0 comments on commit 7cc4970

Please sign in to comment.