diff --git a/.github/workflows/ucc-benchmarks.yml b/.github/workflows/ucc-benchmarks.yml index 1a7e0f8c..3322b4dc 100644 --- a/.github/workflows/ucc-benchmarks.yml +++ b/.github/workflows/ucc-benchmarks.yml @@ -44,11 +44,22 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" + # Ensure the latest changes from the remote branch are fetched + - name: Fetch latest changes and auto-resolve conflicts for .png files + run: | + git fetch origin ${{ github.head_ref || github.ref_name }} + git switch ${{ github.head_ref || github.ref_name }} + + # Merge changes and resolve conflicts favoring the generated .png files + git merge origin/${{ github.head_ref || github.ref_name }} || true + git checkout --theirs -- benchmarks/*.png + git add benchmarks/*.png + + # Commit and push results - name: Commit and push results env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git switch ${{ github.head_ref || github.ref_name }} git add benchmarks/* git status git commit -m "Update benchmark results" || echo "No changes to commit"