@@ -3,42 +3,58 @@ name: Update Playwright Expectations
3
3
4
4
on :
5
5
pull_request :
6
- types : [ labeled ]
6
+ types : [labeled]
7
+ issue_comment :
8
+ types : [created]
7
9
8
10
jobs :
9
11
test :
10
12
runs-on : ubuntu-latest
11
- if : github.event.label.name == 'New Browser Test Expectations'
13
+ if : >
14
+ ( github.event_name == 'pull_request' && github.event.label.name == 'New Browser Test Expectations' ) ||
15
+ ( github.event.issue.pull_request &&
16
+ github.event_name == 'issue_comment' &&
17
+ (
18
+ github.event.comment.author_association == 'OWNER' ||
19
+ github.event.comment.author_association == 'MEMBER' ||
20
+ github.event.comment.author_association == 'COLLABORATOR'
21
+ ) &&
22
+ startsWith(github.event.comment.body, '/update-playwright') )
12
23
steps :
13
- - name : Checkout workflow repo
14
- uses : actions/checkout@v5
15
- - name : Setup Frontend
16
- uses : ./.github/actions/setup-frontend
17
- - name : Setup Playwright
18
- uses : ./.github/actions/setup-playwright
19
- - name : Run Playwright tests and update snapshots
20
- id : playwright-tests
21
- run : pnpm exec playwright test --update-snapshots
22
- continue-on-error : true
23
- working-directory : ComfyUI_frontend
24
- - uses : actions/upload-artifact@v4
25
- if : always()
26
- with :
27
- name : playwright-report
28
- path : ComfyUI_frontend/playwright-report/
29
- retention-days : 30
30
- - name : Debugging info
31
- run : |
32
- echo "Branch: ${{ github.head_ref }}"
33
- git status
34
- working-directory : ComfyUI_frontend
35
- - name : Commit updated expectations
36
- run : |
37
- git config --global user.name 'github-actions'
38
- git config --global user.email '[email protected] '
39
- git fetch origin ${{ github.head_ref }}
40
- git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
41
- git add browser_tests
42
- git commit -m "[automated] Update test expectations"
43
- git push origin HEAD:${{ github.head_ref }}
44
- working-directory : ComfyUI_frontend
24
+ - name : Initial Checkout
25
+ uses : actions/checkout@v5
26
+ - name : Pull Request Checkout
27
+ run : gh pr checkout ${{ github.event.issue.number }}
28
+ if : github.event.issue.pull_request && github.event_name == 'issue_comment'
29
+ env :
30
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31
+ - name : Setup Frontend
32
+ uses : ./.github/actions/setup-frontend
33
+ - name : Setup Playwright
34
+ uses : ./.github/actions/setup-playwright
35
+ - name : Run Playwright tests and update snapshots
36
+ id : playwright-tests
37
+ run : pnpm exec playwright test --update-snapshots
38
+ continue-on-error : true
39
+ working-directory : ComfyUI_frontend
40
+ - uses : actions/upload-artifact@v4
41
+ if : always()
42
+ with :
43
+ name : playwright-report
44
+ path : ComfyUI_frontend/playwright-report/
45
+ retention-days : 30
46
+ - name : Debugging info
47
+ run : |
48
+ echo "PR: ${{ github.event.issue.number }}"
49
+ git status
50
+ working-directory : ComfyUI_frontend
51
+ - name : Commit updated expectations
52
+ run : |
53
+ git config --global user.name 'github-actions'
54
+ git config --global user.email '[email protected] '
55
+ git add browser_tests
56
+ git diff --cached --quiet || git commit -m "[automated] Update test expectations"
57
+ git push
58
+ env :
59
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60
+ working-directory : ComfyUI_frontend
0 commit comments