Skip to content

Commit

Permalink
Git rebase before adding changes (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Aug 24, 2024
1 parent 4c8b4e6 commit 4c61a5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,12 @@ runs:
- name: Commit and Push Changes
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action != 'closed'
run: |
git config --global user.name "UltralyticsAssistant"
git config --global user.email "web@ultralytics.com"
git pull --rebase # pull the latest changes from the remote branch and rebase to avoid merge commit
git add .
git reset HEAD -- .github/workflows/ # workflow changes are not permitted with default token
if ! git diff --staged --quiet; then
git config --global user.name "UltralyticsAssistant"
git config --global user.email "web@ultralytics.com"
git commit -m "Auto-format by https://ultralytics.com/actions"
git push
else
Expand Down

0 comments on commit 4c61a5c

Please sign in to comment.