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
34 changes: 28 additions & 6 deletions .github/workflows/vnext-compat.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: vnext compatibility check

# Runs on every PR targeting main. Simulates squashing the PR onto main, then
# attempts a dry-run rebase of vnext onto the result. If vnext would conflict,
# the check fails and posts a comment with exact commands to resolve it.
# Runs on every PR regardless of base branch, so this can safely be made a
# required status check without hanging PRs whose base isn't main. Simulates
# squashing the PR onto main, then attempts a dry-run rebase of vnext onto the
# result. If vnext would conflict, the check fails and posts a comment with
# exact commands to resolve it.
#
# Skipped for vnext→main release PRs (head_ref == 'vnext') — self-referential.
# Only PRs targeting main do that real work — compat-check is a no-op for
# anything else (including vnext→main release PRs, head_ref == 'vnext'). The
# noop job covers that inverse case, and both paths feed vnext-status so
# there's always a single, consistently-named check to require.

on:
pull_request:
branches: [main]
types: [opened, reopened, synchronize, edited]

permissions:
Expand All @@ -21,7 +25,7 @@ concurrency:
jobs:
compat-check:
name: Check vnext compatibility
if: github.head_ref != 'vnext'
if: github.event.pull_request.base.ref == 'main' && github.head_ref != 'vnext'
runs-on: ubuntu-slim
permissions:
contents: read
Expand Down Expand Up @@ -153,3 +157,21 @@ jobs:
run: |
echo "::error::This PR conflicts with 'vnext' when rebased onto main. See the PR comment for resolution instructions."
exit 1

noop:
name: Skip vnext compatibility check
if: github.event.pull_request.base.ref != 'main' || github.head_ref == 'vnext'
runs-on: ubuntu-slim
steps:
- run: echo "Base isn't main, or this is the vnext release PR — nothing to check here."

vnext-status:
name: vnext compatibility status
needs: [compat-check, noop]
if: always()
runs-on: ubuntu-slim
permissions: {}
steps:
Comment thread
lowlydba marked this conversation as resolved.
- uses: lowlydba/are-we-good@f506ed6324f55ec5e4ff5d92204a72c7f1c2b4f8 # v1.0.5
with:
jobs: ${{ toJSON(needs) }}
Loading