don't fail without write access

This commit is contained in:
A. J. Kaptijn 2024-01-17 12:22:46 +01:00
parent 26b8b7c891
commit 39a2ecbea2
2 changed files with 120 additions and 111 deletions

5
dist/index.js generated vendored
View file

@ -283,6 +283,7 @@ class TestReporter {
} }
} }
core.info(`Creating check run ${name}`); core.info(`Creating check run ${name}`);
try {
const createResp = yield this.octokit.rest.checks.create(Object.assign({ head_sha: this.context.sha, name, status: 'in_progress', output: { const createResp = yield this.octokit.rest.checks.create(Object.assign({ head_sha: this.context.sha, name, status: 'in_progress', output: {
title: name, title: name,
summary: '' summary: ''
@ -338,6 +339,10 @@ class TestReporter {
}); });
yield webhook.send(req); yield webhook.send(req);
} }
}
catch (error) {
core.error(`Could not create check to store the results`);
}
return results; return results;
}); });
} }

View file

@ -184,6 +184,7 @@ class TestReporter {
} }
core.info(`Creating check run ${name}`) core.info(`Creating check run ${name}`)
try {
const createResp = await this.octokit.rest.checks.create({ const createResp = await this.octokit.rest.checks.create({
head_sha: this.context.sha, head_sha: this.context.sha,
name, name,
@ -259,6 +260,9 @@ class TestReporter {
await webhook.send(req) await webhook.send(req)
} }
} catch (error) {
core.error(`Could not create check to store the results`)
}
return results return results
} }