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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6c85d4d
commit f2f4604
Showing
4 changed files
with
29 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ indent_size = 4 | |
|
||
[*.sh] | ||
indent_size = 2 | ||
indent_style = tab | ||
indent_style = space |
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 |
---|---|---|
|
@@ -7,8 +7,8 @@ set -x | |
source sync_common.sh | ||
|
||
[ -z "${GITHUB_TOKEN}" ] && { | ||
err "Missing input 'github_token: \${{ secrets.GITHUB_TOKEN }}'."; | ||
exit 1; | ||
err "Missing input 'github_token: \${{ secrets.GITHUB_TOKEN }}'."; | ||
exit 1; | ||
}; | ||
|
||
if [[ -z "${SOURCE_REPO_PATH}" ]]; then | ||
|
@@ -22,9 +22,9 @@ SOURCE_REPO_HOSTNAME="${HOSTNAME:-github.com}" | |
SOURCE_REPO_PREFIX="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${SOURCE_REPO_HOSTNAME}/" | ||
|
||
function ssh_setup() { | ||
echo "::group::ssh setup" | ||
echo "::group::ssh setup" | ||
|
||
info "prepare ssh" | ||
info "prepare ssh" | ||
SRC_SSH_FILE_DIR="/tmp/.ssh" | ||
SRC_SSH_PRIVATEKEY_FILE_NAME="id_rsa_actions_template_sync" | ||
export SRC_SSH_PRIVATEKEY_ABS_PATH="${SRC_SSH_FILE_DIR}/${SRC_SSH_PRIVATEKEY_FILE_NAME}" | ||
|
@@ -35,27 +35,27 @@ function ssh_setup() { | |
chmod 600 "${SRC_SSH_PRIVATEKEY_ABS_PATH}" | ||
SOURCE_REPO_PREFIX="git@${SOURCE_REPO_HOSTNAME}:" | ||
|
||
echo "::endgroup::" | ||
echo "::endgroup::" | ||
} | ||
|
||
# Forward to /dev/null to swallow the output of the private key | ||
if [[ -n "${SSH_PRIVATE_KEY_SRC}" ]] &>/dev/null; then | ||
ssh_setup | ||
ssh_setup | ||
fi | ||
|
||
export SOURCE_REPO="${SOURCE_REPO_PREFIX}${SOURCE_REPO_PATH}" | ||
|
||
function git_init() { | ||
echo "::group::git init" | ||
info "set git global configuration" | ||
echo "::group::git init" | ||
info "set git global configuration" | ||
|
||
git config --global user.email "[email protected].${SOURCE_REPO_HOSTNAME}" | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global pull.rebase false | ||
git config --global --add safe.directory /github/workspace | ||
git lfs install | ||
git config --global user.email "[email protected].${SOURCE_REPO_HOSTNAME}" | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global pull.rebase false | ||
git config --global --add safe.directory /github/workspace | ||
git lfs install | ||
|
||
echo "::endgroup::" | ||
echo "::endgroup::" | ||
} | ||
|
||
git_init | ||
|
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