File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 4
4
types : [created, edited]
5
5
permissions :
6
6
contents : read
7
+ checks : write
8
+ pull-requests : read
7
9
jobs :
8
10
playwright :
9
11
runs-on : ubuntu-latest
27
29
run : yarn playwright install --with-deps
28
30
29
31
- name : Run tests
32
+ id : playwright_test
30
33
env :
31
34
PLAYWRIGHT_TEST_BASE_URL : https://deploy-preview-${{ github.event.issue.number }}--cambria-project.netlify.app
35
+ continue-on-error : true
32
36
run : yarn playwright test
37
+
38
+ - name : Update commit status
39
+ uses : actions/github-script@v7
40
+ if : always()
41
+ env :
42
+ TEST_STATUS : ${{ steps.playwright_test.outcome == 'success' && 'success' || 'failure' }}
43
+ with :
44
+ script : |
45
+ // Get the most recent commit on the PR
46
+ const commits = await github.rest.pulls.listCommits({
47
+ owner: context.issue.owner,
48
+ repo: context.issue.repo,
49
+ pull_number: context.issue.number,
50
+ per_page: 1
51
+ });
52
+ const headCommit = commits[0].sha;
53
+ await github.rest.repos.createCommitStatus({
54
+ owner: context.repo.owner,
55
+ repo: context.repo.repo,
56
+ sha: headCommit,
57
+ state: process.env.TEST_STATUS,
58
+ target_url: 'https://deploy-preview-' + context.issue.number + '--cambria-project.netlify.app',
59
+ context: 'Playwright'
60
+ });
You can’t perform that action at this time.
0 commit comments