From 86a38d48fb53b9e22a7f1077d3e9c0bb5858cd0a Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 2 Feb 2025 20:17:09 +0100 Subject: [PATCH 1/2] workflows/eval: fail hard without target run Without a target run, we won't get any rebuild labels, rebuild counts or maintainer pings. This might have been correct before #373935, but by now we run eval on all commits on the target branch, so we should treat it as a failure if we can't find the run. --- .github/workflows/eval.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml index 79384daa6b3e9..4c545f8c08151 100644 --- a/.github/workflows/eval.yml +++ b/.github/workflows/eval.yml @@ -175,7 +175,7 @@ jobs: --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" - exit 0 + exit 1 fi echo "Comparing against $(jq .html_url <<< "$run")" runId=$(jq .id <<< "$run") @@ -189,7 +189,7 @@ jobs: if [[ "$conclusion" != "success" ]]; then echo "Workflow was not successful (conclusion: $conclusion), cannot make comparison" - exit 0 + exit 1 fi echo "targetRunId=$runId" >> "$GITHUB_OUTPUT" From 93df51fa3360017b2e92e6a65246519551cd0c7b Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 2 Feb 2025 20:17:33 +0100 Subject: [PATCH 2/2] workflows/eval: rename BASE_SHA to TARGET_SHA To be in line with the terminology introduced in the README.md in the same folder. --- .github/workflows/eval.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml index 4c545f8c08151..abf9b7c33704e 100644 --- a/.github/workflows/eval.yml +++ b/.github/workflows/eval.yml @@ -171,10 +171,10 @@ jobs: run: | # Get the latest eval.yml workflow run for the PR's target commit if ! run=$(gh api --method GET /repos/"$REPOSITORY"/actions/workflows/eval.yml/runs \ - -f head_sha="$BASE_SHA" -f event=push \ + -f head_sha="$TARGET_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" + echo "Could not find an eval.yml workflow run for $TARGET_SHA, cannot make comparison" exit 1 fi echo "Comparing against $(jq .html_url <<< "$run")" @@ -195,7 +195,7 @@ jobs: echo "targetRunId=$runId" >> "$GITHUB_OUTPUT" env: REPOSITORY: ${{ github.repository }} - BASE_SHA: ${{ needs.attrs.outputs.targetSha }} + TARGET_SHA: ${{ needs.attrs.outputs.targetSha }} GH_TOKEN: ${{ github.token }} - uses: actions/download-artifact@v4