Skip to content

Commit 6920231

Browse files
committed
fix: allow visual baseline commits from CI
1 parent 0b2b4cb commit 6920231

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ jobs:
6060
- name: Commit updated baselines
6161
if: github.event_name != 'pull_request'
6262
run: |
63+
# Mark the checkout as a safe dir before any git command; the
64+
# Playwright container runs as root while the checkout is runner-owned.
65+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
66+
git config user.name "github-actions[bot]"
67+
git config user.email "github-actions[bot]@users.noreply.github.com"
68+
6369
if [ -n "$(git status --porcelain tests)" ]; then
64-
git config user.name "github-actions[bot]"
65-
git config user.email "github-actions[bot]@users.noreply.github.com"
66-
# Mark the checkout as a safe dir (container runs as root).
67-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
68-
git add tests/**/__screenshots__ || true
70+
git add tests/__screenshots__
6971
if ! git diff --cached --quiet; then
7072
git commit -m "chore: update visual baselines [skip ci]"
7173
git push "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" HEAD:${{ github.ref_name }}

0 commit comments

Comments
 (0)