Skip to content

Commit

Permalink
workflows/eval: Make sure to compare against the push run
Browse files Browse the repository at this point in the history
For PRs that get merged without a merge commit like
NixOS@bcc5c14,
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
  • Loading branch information
infinisil committed Nov 30, 2024
1 parent 3b56519 commit e0723ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e0723ea

Please sign in to comment.