From c180eac26c34b51c5c23f7527c38225ab0b15476 Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Thu, 10 Oct 2019 04:11:24 +0200 Subject: [PATCH] Simplify Git remote --- start.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/start.sh b/start.sh index 9164fa5..acc12b3 100755 --- a/start.sh +++ b/start.sh @@ -18,8 +18,6 @@ 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 +remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" -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; +git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION;