Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c180eac

Browse files
authored
Simplify Git remote
1 parent 41f3b5a commit c180eac

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

start.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ fi
1818

1919
cd ${INPUT_DIRECTORY}
2020

21-
# Ensure that the remote of the git repository of the current directory still is the repository where the github action is executed
22-
git remote add origin https://github.com/${GITHUB_REPOSITORY} || git remote set-url origin https://github.com/${GITHUB_REPOSITORY} || true
21+
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
2322

24-
header=$(echo -n "ad-m:${INPUT_GITHUB_TOKEN}" | base64)
25-
git -c http.extraheader="AUTHORIZATION: basic $header" push origin HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION;
23+
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION;

0 commit comments

Comments
 (0)