Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30283,14 +30283,18 @@ async function main() {
const trigger_repo_id = (payload.workflow_run || current_run).head_repository.id;
await Promise.all(workflow_ids.map(async (workflow_id) => {
try {
const { data: { total_count, workflow_runs }, } = await octokit.rest.actions.listWorkflowRuns({
const listWorkflowRunsParams = {
per_page: 100,
owner,
repo,
workflow_id,
branch,
});
console.log(`Found ${total_count} runs total.`);
};
if (only_status && !all_but_latest) {
listWorkflowRunsParams.status = only_status;
}
const workflow_runs = await octokit.paginate(octokit.rest.actions.listWorkflowRuns, listWorkflowRunsParams);
console.log(`Found ${workflow_runs.length} runs total.`);
let cancelBefore = new Date(current_run.created_at);
if (all_but_latest) {
const n = workflow_runs
Expand Down
16 changes: 10 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,21 @@ async function main() {
await Promise.all(
workflow_ids.map(async workflow_id => {
try {
const {
data: { total_count, workflow_runs },
} = await octokit.rest.actions.listWorkflowRuns({
const listWorkflowRunsParams: any = {
per_page: 100,
owner,
repo,
// @ts-ignore
workflow_id,
branch,
});
console.log(`Found ${total_count} runs total.`);
};
if (only_status && !all_but_latest) {
listWorkflowRunsParams.status = only_status;
}
const workflow_runs: any[] = await octokit.paginate(
octokit.rest.actions.listWorkflowRuns,
listWorkflowRunsParams,
);
Comment on lines +72 to +85
Comment on lines +82 to +85
console.log(`Found ${workflow_runs.length} runs total.`);
let cancelBefore = new Date(current_run.created_at);
if (all_but_latest) {
const n = workflow_runs
Expand Down