File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -257,13 +257,24 @@ if git diff --cached --quiet; then
257257 log_info " No changes to documentation"
258258else
259259 log_info " Committing documentation changes..."
260- git commit -m " Update documentation (generated from $CURRENT_BRANCH @$( git -C " $REPO_ROOT " rev-parse --short HEAD) )"
261260
262- log_info " Pushing to gh-pages branch..."
263261 if [[ " $FORCE_PUSH " == true ]]; then
262+ # Use --amend to avoid accumulating commits with large binary files
263+ # Check if there are any commits in the branch
264+ if git rev-parse HEAD > /dev/null 2>&1 ; then
265+ git commit --amend -m " Update documentation (generated from $CURRENT_BRANCH @$( git -C " $REPO_ROOT " rev-parse --short HEAD) )"
266+ else
267+ # First commit on the branch
268+ git commit -m " Update documentation (generated from $CURRENT_BRANCH @$( git -C " $REPO_ROOT " rev-parse --short HEAD) )"
269+ fi
270+
271+ log_info " Pushing to gh-pages branch..."
264272 log_info " Using --force to save git repo size (avoids accumulating large binary files)"
265273 git_push --force origin gh-pages
266274 else
275+ git commit -m " Update documentation (generated from $CURRENT_BRANCH @$( git -C " $REPO_ROOT " rev-parse --short HEAD) )"
276+
277+ log_info " Pushing to gh-pages branch..."
267278 git_push origin gh-pages
268279 fi
269280
You can’t perform that action at this time.
0 commit comments