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
40 changes: 34 additions & 6 deletions .github/workflows/release-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,33 @@ on:
jobs:
detect-changes:
name: Detect Changes Since Last Release
if: startsWith(github.head_ref, 'release-please--')
runs-on: ubuntu-latest
outputs:
desktop: ${{ steps.check.outputs.desktop }}
prev_tag: ${{ steps.check.outputs.prev_tag }}
desktop: ${{ steps.check.outputs.desktop || steps.release-check.outputs.desktop }}
prev_tag: ${{ steps.check.outputs.prev_tag || steps.release-check.outputs.prev_tag }}
is_release: ${{ steps.release-check.outputs.is_release }}
steps:
- name: Check if release PR
id: release-check
env:
HEAD_REF: ${{ github.head_ref }}
run: |
if [[ "$HEAD_REF" == release-please--* ]]; then
echo "is_release=true" >> "$GITHUB_OUTPUT"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
else
echo "is_release=false" >> "$GITHUB_OUTPUT"
echo "desktop=false" >> "$GITHUB_OUTPUT"
echo "prev_tag=" >> "$GITHUB_OUTPUT"
echo "Not a release PR — skipping change detection"
fi

- uses: actions/checkout@v4
if: steps.release-check.outputs.is_release == 'true'
with:
fetch-depth: 0

- name: Check for desktop-related changes since last release
if: steps.release-check.outputs.is_release == 'true'
id: check
run: |
# Find the latest non-staging release tag
Expand Down Expand Up @@ -73,11 +89,22 @@ jobs:
verify-e2e:
name: Verify E2E Passed
needs: detect-changes
if: startsWith(github.head_ref, 'release-please--')
if: ${{ always() && !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Fail if detect-changes did not complete (release PR)
if: startsWith(github.head_ref, 'release-please--') && needs.detect-changes.result != 'success'
run: |
Comment thread
FSM1 marked this conversation as resolved.
echo "::error::detect-changes must succeed before E2E verification."
exit 1

- name: Skip (not a release PR)
if: "!startsWith(github.head_ref, 'release-please--')"
run: echo "Not a release PR — E2E gate not applicable"
Comment thread
FSM1 marked this conversation as resolved.
Comment thread
FSM1 marked this conversation as resolved.

- name: Wait for Web E2E and verify it passed
if: startsWith(github.head_ref, 'release-please--')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down Expand Up @@ -117,7 +144,7 @@ jobs:
echo "Web E2E: passed"

- name: Verify Desktop E2E (if desktop changed)
if: needs.detect-changes.outputs.desktop == 'true'
if: startsWith(github.head_ref, 'release-please--') && needs.detect-changes.outputs.desktop == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREV_TAG: ${{ needs.detect-changes.outputs.prev_tag }}
Expand Down Expand Up @@ -256,8 +283,9 @@ jobs:
echo "Desktop E2E: passed (run ${LATEST_IN_RANGE_RUN_ID} at ${LATEST_IN_RANGE_SHA} with tests executed)"

- name: Skip Desktop E2E (no desktop changes)
if: needs.detect-changes.outputs.desktop != 'true'
if: startsWith(github.head_ref, 'release-please--') && needs.detect-changes.outputs.desktop != 'true'
run: echo "No desktop-related changes since last release — skipping Desktop E2E gate"

- name: Summary
if: startsWith(github.head_ref, 'release-please--')
run: echo "All E2E gates passed — release is safe to merge."