From 358cef57025fcc067d81cd768171cb3f33a28984 Mon Sep 17 00:00:00 2001 From: anarcher Date: Sun, 6 Oct 2019 05:20:52 +0900 Subject: [PATCH] Add INPUT_REPOSITORY for another repository push --- start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 9164fa5..1a72bf1 100755 --- a/start.sh +++ b/start.sh @@ -5,6 +5,7 @@ INPUT_BRANCH=${INPUT_BRANCH:-master} INPUT_FORCE=${INPUT_FORCE:-false} INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'} _FORCE_OPTION='' +REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY} echo "Push to branch $INPUT_BRANCH"; [ -z "${INPUT_GITHUB_TOKEN}" ] && { @@ -19,7 +20,7 @@ fi cd ${INPUT_DIRECTORY} # Ensure that the remote of the git repository of the current directory still is the repository where the github action is executed -git remote add origin https://github.com/${GITHUB_REPOSITORY} || git remote set-url origin https://github.com/${GITHUB_REPOSITORY} || true +git remote add origin https://github.com/${REPOSITORY} || git remote set-url origin https://github.com/${REPOSITORY} || true header=$(echo -n "ad-m:${INPUT_GITHUB_TOKEN}" | base64) git -c http.extraheader="AUTHORIZATION: basic $header" push origin HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION;