workflows/eval: fail hard without target run (#378909)
This commit is contained in:
10
.github/workflows/eval.yml
vendored
10
.github/workflows/eval.yml
vendored
@@ -171,11 +171,11 @@ 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"
|
||||
exit 0
|
||||
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")"
|
||||
runId=$(jq .id <<< "$run")
|
||||
@@ -189,13 +189,13 @@ 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"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user