correcting bug with async env
parent
94c3601e58
commit
237fa754fd
|
@ -6426,11 +6426,11 @@ class GitHub {
|
||||||
}
|
}
|
||||||
static createGitHubCheck(summary) {
|
static createGitHubCheck(summary) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!cloud_runner_options_1.default.githubChecks || !cloud_runner_1.default.isCloudRunnerEnvironment) {
|
if (!cloud_runner_options_1.default.githubChecks || cloud_runner_1.default.isCloudRunnerEnvironment) {
|
||||||
return ``;
|
return ``;
|
||||||
}
|
}
|
||||||
GitHub.startedDate = new Date().toISOString();
|
GitHub.startedDate = new Date().toISOString();
|
||||||
cloud_runner_logger_1.default.log(`POST /repos/${GitHub.owner}/${GitHub.repo}/check-runs`);
|
cloud_runner_logger_1.default.log(`POST /repos/{owner}/{repo}/check-runs`);
|
||||||
const data = {
|
const data = {
|
||||||
owner: GitHub.owner,
|
owner: GitHub.owner,
|
||||||
repo: GitHub.repo,
|
repo: GitHub.repo,
|
||||||
|
@ -6513,7 +6513,7 @@ class GitHub {
|
||||||
if (mode === `create`) {
|
if (mode === `create`) {
|
||||||
throw new Error(`Not supported: only use update`);
|
throw new Error(`Not supported: only use update`);
|
||||||
}
|
}
|
||||||
const workflowsResult = yield GitHub.octokitPAT.request(`GET /repos/${GitHub.owner}/${GitHub.repo}/actions/workflows`, {
|
const workflowsResult = yield GitHub.octokitPAT.request(`GET /repos/{owner}/{repo}/actions/workflows`, {
|
||||||
owner: GitHub.owner,
|
owner: GitHub.owner,
|
||||||
repo: GitHub.repo,
|
repo: GitHub.repo,
|
||||||
});
|
});
|
||||||
|
@ -6521,7 +6521,7 @@ class GitHub {
|
||||||
let selectedId = ``;
|
let selectedId = ``;
|
||||||
for (let index = 0; index < workflowsResult.data.total_count; index++) {
|
for (let index = 0; index < workflowsResult.data.total_count; index++) {
|
||||||
if (workflows[index].name === GitHub.asyncChecksApiWorkflowName) {
|
if (workflows[index].name === GitHub.asyncChecksApiWorkflowName) {
|
||||||
selectedId = workflows[index].id;
|
selectedId = workflows[index].id.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selectedId === ``) {
|
if (selectedId === ``) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -44,12 +44,12 @@ class GitHub {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async createGitHubCheck(summary) {
|
public static async createGitHubCheck(summary) {
|
||||||
if (!CloudRunnerOptions.githubChecks || !CloudRunner.isCloudRunnerEnvironment) {
|
if (!CloudRunnerOptions.githubChecks || CloudRunner.isCloudRunnerEnvironment) {
|
||||||
return ``;
|
return ``;
|
||||||
}
|
}
|
||||||
GitHub.startedDate = new Date().toISOString();
|
GitHub.startedDate = new Date().toISOString();
|
||||||
|
|
||||||
CloudRunnerLogger.log(`POST /repos/${GitHub.owner}/${GitHub.repo}/check-runs`);
|
CloudRunnerLogger.log(`POST /repos/{owner}/{repo}/check-runs`);
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
owner: GitHub.owner,
|
owner: GitHub.owner,
|
||||||
|
@ -134,18 +134,15 @@ class GitHub {
|
||||||
if (mode === `create`) {
|
if (mode === `create`) {
|
||||||
throw new Error(`Not supported: only use update`);
|
throw new Error(`Not supported: only use update`);
|
||||||
}
|
}
|
||||||
const workflowsResult = await GitHub.octokitPAT.request(
|
const workflowsResult = await GitHub.octokitPAT.request(`GET /repos/{owner}/{repo}/actions/workflows`, {
|
||||||
`GET /repos/${GitHub.owner}/${GitHub.repo}/actions/workflows`,
|
owner: GitHub.owner,
|
||||||
{
|
repo: GitHub.repo,
|
||||||
owner: GitHub.owner,
|
});
|
||||||
repo: GitHub.repo,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
const workflows = workflowsResult.data.workflows;
|
const workflows = workflowsResult.data.workflows;
|
||||||
let selectedId = ``;
|
let selectedId = ``;
|
||||||
for (let index = 0; index < workflowsResult.data.total_count; index++) {
|
for (let index = 0; index < workflowsResult.data.total_count; index++) {
|
||||||
if (workflows[index].name === GitHub.asyncChecksApiWorkflowName) {
|
if (workflows[index].name === GitHub.asyncChecksApiWorkflowName) {
|
||||||
selectedId = workflows[index].id;
|
selectedId = workflows[index].id.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selectedId === ``) {
|
if (selectedId === ``) {
|
||||||
|
|
Loading…
Reference in New Issue