Skip to content

Commit

Permalink
workflows/eval: fail hard without target run (#378909)
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil authored Feb 4, 2025
2 parents 8c0869e + 93df51f commit 353c0a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit 353c0a7

Please sign in to comment.