generated from AndreasAugustin/template
-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from AndreasAugustin/feat/hostname_config
feat(hostname): add hostname 🚀
- Loading branch information
Showing
3 changed files
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,10 @@ if [[ -z "${SOURCE_REPO_PATH}" ]]; then | |
exit 1 | ||
fi | ||
|
||
SOURCE_REPO_HOSTNAME="${HOSTNAME:-github.com}" | ||
|
||
# In case of private template repository this will be overwritten | ||
SOURCE_REPO_PREFIX="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/" | ||
SOURCE_REPO_PREFIX="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${SOURCE_REPO_HOSTNAME}/" | ||
|
||
# Forward to /dev/null to swallow the output of the private key | ||
if [[ -n "${SSH_PRIVATE_KEY_SRC}" ]] &>/dev/null; then | ||
|
@@ -26,14 +28,14 @@ if [[ -n "${SSH_PRIVATE_KEY_SRC}" ]] &>/dev/null; then | |
# use cat <<< instead of echo to swallow output of the private key | ||
cat <<< "${SSH_PRIVATE_KEY_SRC}" | sed 's/\\n/\n/g' > "${SRC_SSH_PRIVATEKEY_ABS_PATH}" | ||
chmod 600 "${SRC_SSH_PRIVATEKEY_ABS_PATH}" | ||
SOURCE_REPO_PREFIX="git@github.com:" | ||
SOURCE_REPO_PREFIX="git@${SOURCE_REPO_HOSTNAME}:" | ||
fi | ||
|
||
export SOURCE_REPO="${SOURCE_REPO_PREFIX}${SOURCE_REPO_PATH}" | ||
|
||
echo "::group::git init" | ||
echo "set git global configuration" | ||
git config --global user.email "[email protected].github.com" | ||
git config --global user.email "[email protected].${SOURCE_REPO_HOSTNAME}" | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global pull.rebase false | ||
echo "::endgroup::" | ||
|