-
Notifications
You must be signed in to change notification settings - Fork 2.2k
51 lines (41 loc) · 1.36 KB
/
update-screenshots.yml
File metadata and controls
51 lines (41 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update Screenshots
on:
pull_request:
types: [labeled]
workflow_dispatch:
jobs:
update-screenshots:
if: ${{ github.event.label.name == 'Update Screenshots' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
# one at a time per branch
concurrency:
group: update-screenshots@${{ github.head_ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
- uses: voidzero-dev/setup-vp@v1
with:
node-version: 25
- name: Remove label
if: github.event_name == 'pull_request'
run: gh pr edit --remove-label 'Update Screenshots'
env:
GH_TOKEN: ${{ github.token }}
- name: Install Playwright Browsers
run: vpx playwright install chromium firefox
- name: Update screenshots
run: |
rm -r test/**/screenshots/**
vp test --project visual --update
- name: Push new screenshots
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git add "test/**/screenshots/**"
git diff-index --quiet HEAD || git commit -m "Update screenshots"
git push