Skip to content

Commit 1d86e55

Browse files
committed
Improve conflict resolving in auto-commits
1 parent 96b1ad3 commit 1d86e55

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/internal-commit-results.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777

7878
- name: Prepare commit of changes in `${{ inputs.commit-directory }}`
7979
run: |
80+
set -x # Print commands and their arguments as they are executed
8081
git config --global user.name '${{ inputs.commit-author-name }}'
8182
git config --global user.email '${{ inputs.commit-author-email }}'
8283
git config --local http.postBuffer 524288000
@@ -89,10 +90,13 @@ jobs:
8990
# Only run when a pull request gets merged or a commit is pushed to the main branch
9091
if: github.event_name == 'push'
9192
run: |
92-
git commit --message "${{ inputs.commit-message }}"
93-
git status
94-
git rebase --strategy-option=theirs origin/main --verbose
95-
git status
96-
git add ${{ env.GIT_ADD_PATH }} ${{ env.SECOND_GIT_ADD_PATH }}
97-
git status
98-
git push --verbose
93+
set -x # Print commands and their arguments as they are executed
94+
git commit --message "${{ inputs.commit-message }}"
95+
git status
96+
git rebase --strategy-option=theirs origin/main --verbose # Resolve conflicts by taking the current branch's changes
97+
git add ${{ env.GIT_ADD_PATH }} ${{ env.SECOND_GIT_ADD_PATH }} # Add the files again after the rebase
98+
GIT_EDITOR=true git rebase --continue || true # Continue the rebase or ignore if it fails
99+
git status
100+
git commit --amend --no-edit # Amend the commit to include the changes from the rebase
101+
git status
102+
git push --force-with-lease --verbose

.github/workflows/internal-report-reference-documentation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ on:
88
- "analysis-results/**" # Only run on changed analysis results
99
- "!analysis-results/*.md" # Ignore report reference documentation changes (endless loop prevention)
1010
- ".github/workflows/internal-report-reference-documentation.yml" # Also run when this file was changed
11+
- ".github/workflows/internal-commit-results" # Also run when the commit-results workflow was changed
1112
pull_request:
1213
branches:
1314
- main
1415
paths:
1516
- "analysis-results/**" # Only run on changed analysis results
1617
- "!analysis-results/*.md" # Ignore report reference documentation changes (endless loop prevention)
1718
- ".github/workflows/internal-report-reference-documentation.yml" # Also run when this file was changed
19+
- ".github/workflows/internal-commit-results" # Also run when the commit-results workflow was changed
1820

1921
jobs:
2022
generate-report-reference-documentation:

0 commit comments

Comments
 (0)