Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/hub-client-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,30 @@ jobs:
# not one directory deeper.
- name: Commit new baselines
if: steps.visual.outcome == 'failure' && steps.visual-retry.outcome == 'success'
env:
PR_HEAD_REF: ${{ github.head_ref }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if [ -n "$PR_HEAD_REF" ]; then
# PR builds run on a detached merge-commit HEAD, where plain
# `git push` fails ("not currently on a branch") — and pushing
# the merge commit to the branch would be wrong anyway. Commit
# the baselines on top of the real branch tip instead. The
# generated PNGs are gitignored, so they survive this checkout.
# The default fetch-depth-1 checkout only has the merge commit,
# so fetch the head SHA explicitly.
git fetch --depth=1 origin "$PR_HEAD_SHA"
git checkout -B ci-baseline-commit "$PR_HEAD_SHA"
fi
find hub-client/e2e -type d -name '*-snapshots' -exec git add -f {} +
git diff --cached --quiet || git commit -m "Add missing Playwright visual regression baselines"
git push
if [ -n "$PR_HEAD_REF" ]; then
git push origin "HEAD:refs/heads/$PR_HEAD_REF"
else
git push
fi

# Fail the workflow if visual retry also failed (real regression)
- name: Fail on visual regression
Expand Down
Loading