Skip to content

Commit 559af9f

Browse files
committed
fix: trigger screenshots on push to main and always commit results
- Add main branch to push triggers so screenshots generate immediately - Remove tag-only gate on commit step - Pass --config flag to Playwright so it finds the config - Use [skip ci] in commit message to avoid infinite loops
1 parent 1acdb02 commit 559af9f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/screenshots.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Generate Screenshots
22

33
on:
44
push:
5+
branches: [main]
56
tags: ['v*']
67
workflow_dispatch:
78

@@ -79,7 +80,7 @@ jobs:
7980
- name: Take Screenshots
8081
run: |
8182
cd $GITHUB_WORKSPACE
82-
npx playwright test screenshots/wp-admin.spec.js --reporter=list
83+
npx playwright test screenshots/wp-admin.spec.js --config=screenshots/playwright.config.js --reporter=list
8384
8485
- name: Upload Screenshots
8586
uses: actions/upload-artifact@v4
@@ -88,10 +89,9 @@ jobs:
8889
path: screenshots/results/
8990

9091
- name: Commit Screenshots
91-
if: github.ref_type == 'tag'
9292
run: |
9393
git config user.name "github-actions[bot]"
9494
git config user.email "github-actions[bot]@users.noreply.github.com"
9595
git add screenshots/results/
96-
git commit -m "docs: update wp-admin screenshots" || true
96+
git diff --staged --quiet || git commit -m "docs: update wp-admin screenshots [skip ci]"
9797
git push origin HEAD:main || true

0 commit comments

Comments
 (0)