@@ -15,14 +15,16 @@ jobs:
1515 with :
1616 github-token : ${{ secrets.GITHUB_TOKEN }}
1717 script : |
18- github.repos.createStatus({
19- owner: context.repo.owner,
20- repo: context.repo.repo,
21- sha: context.payload.client_payload.pull_request.head.sha,
22- state: 'pending',
23- target_url: `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
24- context: 'Test Windows',
25- })
18+ async ({ github, context }) => {
19+ await github.rest.repos.createCommitStatus({
20+ owner: context.repo.owner,
21+ repo: context.repo.repo,
22+ sha: context.payload.client_payload.pull_request.head.sha,
23+ state: 'pending',
24+ target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
25+ context: 'Test Windows',
26+ });
27+ }
2628
2729 - name : Checkout
2830 uses : actions/checkout@v4
@@ -46,28 +48,32 @@ jobs:
46484749 if : success()
4850 with :
49- github-token : ${{secrets.GITHUB_TOKEN}}
51+ github-token : ${{ secrets.GITHUB_TOKEN }}
5052 script : |
51- github.repos.createStatus({
52- owner: context.repo.owner,
53- repo: context.repo.repo,
54- sha: context.payload.client_payload.pull_request.head.sha,
55- state: 'success',
56- target_url: `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
57- context: 'Test Windows',
58- })
53+ async ({ github, context }) => {
54+ await github.rest.repos.createCommitStatus({
55+ owner: context.repo.owner,
56+ repo: context.repo.repo,
57+ sha: context.payload.client_payload.pull_request.head.sha,
58+ state: 'success',
59+ target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
60+ context: 'Test Windows',
61+ });
62+ }
5963
6064 - name : Create failure status
61656266 if : failure()
6367 with :
64- github-token : ${{secrets.GITHUB_TOKEN}}
68+ github-token : ${{ secrets.GITHUB_TOKEN }}
6569 script : |
66- github.repos.createStatus({
67- owner: context.repo.owner,
68- repo: context.repo.repo,
69- sha: context.payload.client_payload.pull_request.head.sha,
70- state: 'failure',
71- target_url: `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
72- context: 'Test Windows',
73- })
70+ async ({ github, context }) => {
71+ await github.rest.repos.createCommitStatus({
72+ owner: context.repo.owner,
73+ repo: context.repo.repo,
74+ sha: context.payload.client_payload.pull_request.head.sha,
75+ state: 'failure',
76+ target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
77+ context: 'Test Windows',
78+ });
79+ }
0 commit comments