Skip to content

Commit

Permalink
Merge pull request #28 from sta-szek/patch-1
Browse files Browse the repository at this point in the history
Allow to specify git host
  • Loading branch information
dmnemec committed Oct 25, 2021
2 parents b2ead04 + f72011b commit 5116b9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ inputs:
use_rsync:
description: 'Copy files/directories using rsync instead of cp. Experimental feature, please know your use case'
required: false
git_server:
description: 'Git server host, default github.com'
required: true
default: github.com
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -42,6 +46,7 @@ runs:
- ${{ inputs.destination-branch }}
- ${{ inputs.destination-branch-create }}
- ${{ inputs.commit-message }}
- ${{ inputs.github-server }}
- ${{ inputs.rename }}
- ${{ inputs.use-rsync }}
branding:
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CLONE_DIR=$(mktemp -d)
echo "Cloning destination git repository"
git config --global user.email "$INPUT_USER_EMAIL"
git config --global user.name "$INPUT_USER_NAME"
git clone --single-branch --branch $INPUT_DESTINATION_BRANCH "https://x-access-token:$API_TOKEN_GITHUB@github.com/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR"
git clone --single-branch --branch $INPUT_DESTINATION_BRANCH "https://x-access-token:$API_TOKEN_GITHUB@$INPUT_GITHUB_SERVER/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR"

if [ ! -z "$INPUT_RENAME" ]
then
Expand Down Expand Up @@ -51,7 +51,7 @@ fi

if [ -z "$INPUT_COMMIT_MESSAGE" ]
then
INPUT_COMMIT_MESSAGE="Update from https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
INPUT_COMMIT_MESSAGE="Update from https://$INPUT_GITHUB_SERVER/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
fi

echo "Adding git commit"
Expand Down

0 comments on commit 5116b9f

Please sign in to comment.