Add deploy key functionality (#115)

* Add deploy key functionality
This commit is contained in:
Pascal Zimmermann
2022-05-04 13:00:55 +02:00
committed by GitHub
parent 694e694af3
commit d4a6a7883a
4 changed files with 45 additions and 10 deletions

View File

@@ -23,7 +23,13 @@ fi
cd ${INPUT_DIRECTORY}
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
if ${INPUT_SSH}; then
remote_repo="git@${INPUT_GITHUB_URL}:${REPOSITORY}.git"
else
remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git"
fi
git config --local --add safe.directory ${INPUT_DIRECTORY}
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;