From 7f993c32bd9fefd6e22a1f20125ece9409e06441 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 6 Mar 2024 09:26:10 -0600 Subject: [PATCH] pr-check: Apply a stable sort --- .github/workflows/pr-check.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.rb b/.github/workflows/pr-check.rb index 8b25210..f13b034 100644 --- a/.github/workflows/pr-check.rb +++ b/.github/workflows/pr-check.rb @@ -20,7 +20,9 @@ def next_state(state) def sort_and_check(arr, label) begin - sorted = arr.sort_by{|l| l.scan(/^\| \[([^\]]+)\]/).first.first.downcase } + sorted = arr.sort_by.with_index{|l,i| + [ l.scan(/^\| \[([^\]]+)\]/).first.first.downcase, i ] + } rescue => e return false end