Skip to content

Commit c6bf97f

Browse files
authored
Move git config step before git remote command
1 parent 6704201 commit c6bf97f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ chmod 600 "$SSH_PATH/deploy_key"
1212

1313
GIT_COMMAND="git push dokku@$HOST:$PROJECT"
1414

15+
# prevent dubious ownership error due to ownership mismatch in parent directories
16+
# see: https://github.com/vitalyliber/dokku-github-action/issues/25
17+
echo "Adding repository directory to the git global config as a safe directory"
18+
git config --global --add safe.directory /github/workspace
19+
1520
echo "Testing git remote output"
1621
git remote show origin 2>&1
1722

18-
1923
echo "Detect the project default branch: master or main"
2024
DEFAULT_BRANCH="$(git remote show origin | awk '/HEAD branch/ {print $NF}')"
2125

@@ -57,10 +61,6 @@ if [ -n "$APP_CONFIG" ]; then
5761
$GIT_SSH_COMMAND dokku@$HOST config:set --no-restart $PROJECT $APP_CONFIG > /dev/null 2>&1
5862
fi
5963

60-
# prevent dubious ownership error due to ownership mismatch in parent directories
61-
# see: https://github.com/vitalyliber/dokku-github-action/issues/25
62-
echo "Adding repository directory to the git global config as a safe directory"
63-
git config --global --add safe.directory /github/workspace
6464

6565
echo "The deploy is starting"
6666

0 commit comments

Comments
 (0)