From b3e8e251f3087eaa971a087f9948bbf21ae3d14d 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 whose commits end up as HEAD of master like https://github.com/NixOS/nixpkgs/commit/bcc5c141bf43460909b83740e96ceeea6d0f7e12, there might be workflow runs associated with both PRs and pushes. Only 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"