From e91de73442890a712d1aa9cee5f6c096404d01f0 Mon Sep 17 00:00:00 2001 From: Chris Berg Date: Tue, 19 Nov 2024 09:33:36 -0800 Subject: [PATCH] fix: sort the list of merges by reverse timestamp to ensure the most rescent merge is pulled --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index b393b62..57fa037 100644 --- a/action.yml +++ b/action.yml @@ -53,8 +53,8 @@ runs: pr=$(\ curl -sL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ inputs.token }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/search/issues\?q\=repo:${{ github.repository }}+is:pr+is:merged \ - | jq .items[0].number + https://api.github.com/search/issues\?q\=repo:bcgov/onroutebc+is:pr+is:merged \ + | jq '.items | sort_by(.pull_request.merged_at) | reverse'[0].number ) if [ -z "${pr}" ]