@@ -68,16 +68,35 @@ jobs:
6868 title: 'LDK Node integration check failed',
6969 summary: 'The LDK Node integration build failed. This does not block the PR.',
7070 };
71- const checks = await github.rest.checks.listForRef({
71+ const allChecks = await github.rest.checks.listForRef({
7272 owner: context.repo.owner,
7373 repo: context.repo.repo,
7474 ref: context.sha,
75- check_name: context.job,
7675 });
77- await github.rest.checks.update({
76+ core.info(`context.job = ${context.job}`);
77+ core.info(`All check runs: ${JSON.stringify(allChecks.data.check_runs.map(c => c.name))}`);
78+ const checks = await github.rest.checks.listForRef({
7879 owner: context.repo.owner,
7980 repo: context.repo.repo,
80- check_run_id: checks.data.check_runs[0].id,
81- conclusion: 'neutral',
82- output,
81+ ref: context.sha,
82+ check_name: context.job,
8383 });
84+ if (checks.data.check_runs.length > 0) {
85+ await github.rest.checks.update({
86+ owner: context.repo.owner,
87+ repo: context.repo.repo,
88+ check_run_id: checks.data.check_runs[0].id,
89+ conclusion: 'neutral',
90+ output,
91+ });
92+ } else {
93+ core.info('No matching check run found, creating new one');
94+ await github.rest.checks.create({
95+ owner: context.repo.owner,
96+ repo: context.repo.repo,
97+ head_sha: context.sha,
98+ name: context.job,
99+ conclusion: 'neutral',
100+ output,
101+ });
102+ }
0 commit comments