Skip to content

Commit

Permalink
Add missing new Promise.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Sep 13, 2020
1 parent b2256a7 commit 0590c9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,16 @@ class RerunWorkflowAction {
}

await Promise.all(
pullRequests.map(({ number, labels }) => async () => {
if (this.input.onceLabel && labels.includes(this.input.onceLabel)) {
await this.rerunWorkflowsForPullRequest(octokit, number, RerunCondition.Always)
} else if (this.input.continuousLabel && labels.includes(this.input.continuousLabel)) {
await this.rerunWorkflowsForPullRequest(octokit, number, RerunCondition.OnFailure)
}
})
pullRequests.map(
({ number, labels }) =>
new Promise(async () => {
if (this.input.onceLabel && labels.includes(this.input.onceLabel)) {
await this.rerunWorkflowsForPullRequest(octokit, number, RerunCondition.Always)
} else if (this.input.continuousLabel && labels.includes(this.input.continuousLabel)) {
await this.rerunWorkflowsForPullRequest(octokit, number, RerunCondition.OnFailure)
}
})
)
)
}

Expand Down

0 comments on commit 0590c9e

Please sign in to comment.