If two workflow runs targeting different commits are triggered in quick succession, and the workflow run based on the old commit finishes last, then the artifact chosen will be based on the old commit.
The sorting logic should be improved to handle this case:
|
let mut workflow_runs = client.get_workflow_runs(owner, repository).await?.workflow_runs; |
|
workflow_runs.sort_by_key(|run| cmp::Reverse(run.updated_at)); |
If two workflow runs targeting different commits are triggered in quick succession, and the workflow run based on the old commit finishes last, then the artifact chosen will be based on the old commit.
The sorting logic should be improved to handle this case:
server-wrapper/src/source/github.rs
Lines 37 to 38 in 7bf3579