File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 18
18
script : |
19
19
const external_id = context.payload.workflow_run.html_url;
20
20
const head_sha = context.payload.workflow_run.head_sha;
21
+ const runs = await github.paginate(github.rest.checks.listForRef, {
22
+ ...context.repo,
23
+ ref: head_sha,
24
+ check_name: "integration-test-result",
25
+ external_id,
26
+ })
27
+ core.debug(`integration-test-result check runs: ${JSON.stringify(runs, null, 2)}`);
28
+ const filtRuns = runs.filter(run => run.status !== 'completed');
29
+ const descRuns = filtRuns.sort((a, b) => Date.parse(b.started_at) - Date.parse(a.started_at));
30
+ const run = descRuns[0];
31
+
32
+ if (run) {
33
+ // Check already exists.
34
+ return run.id;
35
+ }
36
+
21
37
const check = await github.rest.checks.create({
22
38
...context.repo,
23
39
head_sha,
You can’t perform that action at this time.
0 commit comments