Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tpikachu committed Feb 21, 2024
1 parent 598a85c commit 95b2828
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31587,10 +31587,10 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
}
);

await waitFor(1000 * 60 * 5); // wait 5 minutes for workflow to complete
await waitFor(1000 * 60 * 2); // wait 5 minutes for workflow to complete

const fiveMinsAgo = new Date();
fiveMinsAgo.setMinutes(fiveMinsAgo.getMinutes() - 5);
fiveMinsAgo.setMinutes(fiveMinsAgo.getMinutes() - 2);

const workflowResponse = await octokit.request(
`GET /repos/{owner}/{repo}/actions/runs?created=>{time}&branch={branch}&event={trigger}`,
Expand All @@ -31604,7 +31604,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
);
const runs = workflowResponse.data.workflow_runs || [];

let workflowId;
let workflowId, workflowUrl;

for (let i in runs) {
const workflowRun = runs[i];
Expand Down Expand Up @@ -31636,7 +31636,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
}
}

console.log(workflowId);
console.log(workflowId, workflowUrl);
})();

})();
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
}
);

await waitFor(1000 * 60 * 5); // wait 5 minutes for workflow to complete
await waitFor(1000 * 60 * 2); // wait 5 minutes for workflow to complete

const fiveMinsAgo = new Date();
fiveMinsAgo.setMinutes(fiveMinsAgo.getMinutes() - 5);
fiveMinsAgo.setMinutes(fiveMinsAgo.getMinutes() - 2);

const workflowResponse = await octokit.request(
`GET /repos/{owner}/{repo}/actions/runs?created=>{time}&branch={branch}&event={trigger}`,
Expand All @@ -57,7 +57,7 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
);
const runs = workflowResponse.data.workflow_runs || [];

let workflowId;
let workflowId, workflowUrl;

for (let i in runs) {
const workflowRun = runs[i];
Expand Down Expand Up @@ -89,5 +89,5 @@ const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
}
}

console.log(workflowId);
console.log(workflowId, workflowUrl);
})();

0 comments on commit 95b2828

Please sign in to comment.