Skip to content

Commit 29b7249

Browse files
authored
Merge pull request #27 from Kurt-von-Laven/no-merge-commits
fix: Configure git pull to rebase instead of merge
2 parents 309a4c6 + 76402d7 commit 29b7249

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ if [ "$INPUT_COMMIT" == 'false' ]; then INPUT_COMMIT='--files-only'; else INPUT_
77
if [ "$INPUT_COMMITIZEN_VERSION" == 'latest' ]; then INPUT_COMMITIZEN_VERSION="commitizen"; else INPUT_COMMITIZEN_VERSION="commitizen==$INPUT_COMMITIZEN_VERSION"; fi
88
if [ -n "$INPUT_NO_RAISE" ]; then INPUT_NO_RAISE="--no-raise $INPUT_NO_RAISE"; else INPUT_NO_RAISE=''; fi
99

10-
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
10+
CURRENT_BRANCH="$(git branch --show-current)"
1111
INPUT_BRANCH=${INPUT_BRANCH:-$CURRENT_BRANCH}
1212
INPUT_EXTRA_REQUIREMENTS=${INPUT_EXTRA_REQUIREMENTS:-''}
1313
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
14-
# : "${INPUT_CHANGELOG:=true}" ignroed for now, let's check that it works
14+
# : "${INPUT_CHANGELOG:=true}" ignored for now, let's check that it works
1515

1616
set -e
1717

@@ -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

@@ -53,7 +54,7 @@ if [ "$INPUT_PUSH" == "true" ]; then
5354
echo "Pushing to branch..."
5455
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
5556
git pull ${remote_repo} ${INPUT_BRANCH}
56-
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags --tags
57+
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --tags
5758
else
5859
echo "Not pushing"
5960
fi

0 commit comments

Comments
 (0)