Skip to content

Commit 76402d7

Browse files
fix: Configure git pull to rebase instead of merge
If the branch has not been updated while the action is running, then the pull will be a no-op either way, and the push will succeed. If the branch has been updated since the repository was initially checked out, then rebase rather than merge when pulling so that no merge commit will be created. If the rebase can not be performed non-interactively, then it will fail immediately, and there's nothing further that can be done. Configuring pull behavior has the added benefit of eliminating a twelve-line warning from Git about pulling without specifying how to reconcile divergent branches.
1 parent 755f6c3 commit 76402d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ pip install "$INPUT_COMMITIZEN_VERSION" $INPUT_EXTRA_REQUIREMENTS
2828
echo "Commitizen version:"
2929
cz version
3030

31-
echo "Configuring git user and email..."
31+
echo "Configuring Git username, email, and pull behavior..."
3232
git config --local user.name "$INPUT_GIT_NAME"
3333
git config --local user.email "$INPUT_GIT_EMAIL"
34+
git config --local pull.rebase true
3435
echo "Git name: $(git config --get user.name)"
3536
echo "Git email: $(git config --get user.email)"
3637

0 commit comments

Comments
 (0)