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