Skip to content

Commit

Permalink
Combine checkout, merging, and push of new results
Browse files Browse the repository at this point in the history
Make sure we add the right .png files
  • Loading branch information
jordandsullivan authored Jan 2, 2025
1 parent f4103b8 commit a1933e4
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/ucc-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,26 @@ jobs:
"
# Commit and push benchmark results
- name: Configure Git for commit
- name: Commit and push benchmark results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure Git
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: |
# Ensure we are on the correct branch
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
# Merge latest changes and resolve conflicts for .png files
git merge origin/${{ github.head_ref || github.ref_name }} || true
git checkout --theirs -- benchmarks/*.png
# Commit and push results
- name: Commit and push results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add benchmarks/* # Add all changes in benchmarks/

# Stage all changes (including resolved .png files)
git add benchmarks/*
git status

# Commit and push changes
git commit -m "Update benchmark results" || echo "No changes to commit"
git push origin HEAD:${{ github.head_ref || github.ref_name }}

0 comments on commit a1933e4

Please sign in to comment.