-
Notifications
You must be signed in to change notification settings - Fork 77
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
Handle multiple types for advanced scenarios #143
base: main
Are you sure you want to change the base?
Handle multiple types for advanced scenarios #143
Conversation
if (lastSuccessfulEvent.includes(",")) { | ||
// find the greatest workflow id among the types and retrieve the sha | ||
const events = lastSuccessfulEvent.split(","); | ||
const workflowIdMap = new Map(); | ||
for (const event of events) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
condition and the else
code path below seems unnecessary. A string with no commas, e.g. "foo"
, will split(",")
to ["foo"]
and the iteration will work fine over that single element.
}); | ||
workflowIdMap.set(workflowRun.id, workflowRun.head_sha); | ||
} | ||
shas.push(workflowIdMap.get(Math.max(...workflowIdMap.keys()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it will push all the SHAs from one event, then all of them from another. So they won't be in order in the final array. Which means the call to findExistingCommit
below, which returns the first commit in the list that exists, might not return the correct commit?
6888a24
to
ab3c552
Compare
No description provided.