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 44 types : [created, edited]
55permissions :
66 contents : read
7+ checks : write
8+ pull-requests : read
79jobs :
810 playwright :
911 runs-on : ubuntu-latest
2729 run : yarn playwright install --with-deps
2830
2931 - name : Run tests
32+ id : playwright_test
3033 env :
3134 PLAYWRIGHT_TEST_BASE_URL : https://deploy-preview-${{ github.event.issue.number }}--cambria-project.netlify.app
35+ continue-on-error : true
3236 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