Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/windows-render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,30 @@ jobs:
if: always() && (needs.changes.outputs.code == 'true' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
timeout-minutes: 2
permissions:
actions: read
steps:
# On a PR, a cancelled lane passes only when a newer run of this workflow
# exists for the branch (concurrency cancelled this one). Push runs, a manual
# cancel of the latest run and any API error still fail.
- name: Require all Windows test lanes
if: needs.test-windows-lane.result != 'success'
env:
GH_TOKEN: ${{ github.token }}
LANE_RESULT: ${{ needs.test-windows-lane.result }}
BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
if [ "$LANE_RESULT" = "cancelled" ] && [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
api="repos/$GITHUB_REPOSITORY/actions"
HEAD_REPO=$(gh api "$api/runs/$GITHUB_RUN_ID" --jq .head_repository.full_name)
export HEAD_REPO
newer=$(gh api "$api/workflows/windows-render.yml/runs" -X GET \
-f event="$GITHUB_EVENT_NAME" -f branch="$BRANCH" -f per_page=100 \
--jq '[.workflow_runs[] | select(.id > (env.GITHUB_RUN_ID | tonumber) and .head_repository.full_name == env.HEAD_REPO)] | length')
if [ "$newer" -gt 0 ]; then
echo "::notice::Superseded by a newer run; it reports the Windows result."
exit 0
fi
fi
echo "::error::One or more Windows test lanes did not succeed."
exit 1
Loading