From e0723eaa7907acc64edaa260c781861b0233bb82 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sat, 30 Nov 2024 02:01:34 +0100 Subject: [PATCH] workflows/eval: Make sure to compare against the push run For PRs that get merged without a merge commit like https://github.com/NixOS/nixpkgs/commit/bcc5c141bf43460909b83740e96ceeea6d0f7e12, the eval workflow has two associated runs for the commit, one for the push event and one for the pull request event. The pull request event doesn't run fully because the PR is already closed, the push event is the one that will run fully and should be used to compare against. So far it didn't distinguish between the two events, causing it to sometimes pick the wrong one and then fail to download non-existent artifacts: https://github.com/NixOS/nixpkgs/actions/runs/12092053414/job/33721377179 This commit fixes that by ensuring that the push event result is compared against --- .github/workflows/eval.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml index 90be4670e414b..1494d97141bb4 100644 --- a/.github/workflows/eval.yml +++ b/.github/workflows/eval.yml @@ -168,7 +168,7 @@ jobs: run: | # Get the latest eval.yml workflow run for the PR's base commit if ! run=$(gh api --method GET /repos/"$REPOSITORY"/actions/workflows/eval.yml/runs \ - -f head_sha="$BASE_SHA" \ + -f head_sha="$BASE_SHA" -f event=push \ --jq '.workflow_runs | sort_by(.run_started_at) | .[-1]') \ || [[ -z "$run" ]]; then echo "Could not find an eval.yml workflow run for $BASE_SHA, cannot make comparison"