Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include queued runs in previousRun #11

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,17 @@ export class OctokitGitHub implements GitHub {
const options: Octokit.EndpointOptions = {
owner,
repo,
workflow_id,
status: "in_progress"
workflow_id
};

if (branch) {
options.branch = branch;
}

return this.octokit.paginate(
this.octokit.actions.listWorkflowRuns.endpoint.merge(options)
);
return this.octokit
.paginate(this.octokit.actions.listWorkflowRuns.endpoint.merge(options))
.then(runs =>
runs.filter(run => ["in_progress", "queued"].includes(run.status))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this run, the one querying for a prior active run, is in progress how would it be possible for a previous run to be queued?

In a build queue it's first in first out so if the previous run was queued that implies the current run has not yet started.

);
};
}