ci: fix 'Commit new baselines' push on pull_request builds - #606
Merged
Conversation
The step ran plain `git push`, but PR builds check out a detached merge-commit HEAD, so the push failed with 'not currently on a branch' (run 32953026576, on the hub-client-uiux-phase0 PR — the first to hit the missing-baseline path on a PR). On PRs, fetch the PR head SHA (the default fetch-depth-1 checkout only has the merge commit), commit the generated baselines on top of it, and push to the head branch. The gitignored PNGs survive the checkout. Push events (main) keep the existing behavior.
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Commit new baselinesstep inhub-client-e2e.ymlran plaingit push, but PR builds check out a detached merge-commit HEAD, so the push fails withfatal: You are not currently on a branch(run 32953026576, on the hub-client-uiux-phase0 PR — the first to hit the missing-baseline path on a PR).Fix: on PRs, fetch the PR head SHA (the default fetch-depth-1 checkout only has the merge commit), commit the generated baselines on top of it, and push to
HEAD:refs/heads/<head_ref>. The gitignored snapshot PNGs survive the checkout. Push events on main keep the existing behavior.Once this lands, the next phase-0 PR run will auto-commit the 16 missing linux visual baselines that the failed run generated.