Fixes git workspace after checking out benchmarks#1636
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1636 +/- ##
=========================================
Coverage 98.03% 98.03%
Complexity 961 961
=========================================
Files 197 197
Lines 2234 2234
=========================================
Hits 2190 2190
Misses 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes ci-perf.yml failures caused by checking out the benchmarks orphan branch, which breaks subsequent post-run hooks for local/composite actions by restoring the workspace back to the original commit.
Changes:
- Adds an always-run step to restore the git workspace to
${GITHUB_SHA}after pushing benchmark results.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
With the introduction of composite actions in the GitHub workflows, the ci-perf.yml workflow broke. This happens because the setup-action configures a Post Run (a hook to be executed after the workflow). Since the benchmarks checkout a different orphan branch, when that Post Run executes, it cannot find the action anymore. To fix it, I introduce a new step that restores the git workspace, making it available for that hook.
36c2a09 to
b5e3258
Compare
henriquemoody
left a comment
There was a problem hiding this comment.
I'm not absolutely sure, but isn't this what actions/checkout@v6 does? Perhaps we could use it also at the start of the job to checkout the benchmarks branch?
|
If we checkout only the I need to first checkout the codebase, run the benchmarks, then checkout the Perhaps there are better ways of doing it, but I could not find them. I know for sure this restore works because I did it in the PHL repository (it has a similar Perhaps we can do another checkout at the end, but I never tried that. |
|
I suggested using |

With the introduction of composite actions in the GitHub workflows, the ci-perf.yml workflow broke.
This happens because the setup-action configures a Post Run (a hook to be executed after the workflow).
Since the benchmarks checkout a different orphan branch, when that Post Run executes, it cannot find the action anymore.
To fix it, I introduce a new step that restores the git workspace, making it available for that hook.
Example failure:
https://github.com/Respect/Validation/actions/runs/21448771339/job/61772437584