From 41553bbbb7fd070f7634d023d745327da3bf4b96 Mon Sep 17 00:00:00 2001 From: Justin Hernandez Date: Wed, 19 Nov 2025 10:19:44 -0300 Subject: [PATCH] Prevent mobile deploy on auto-closed PRs (#1433) * Prevent mobile deploy on auto-closed PRs * Fix auto-closed PR guard in mobile deploy --- .github/workflows/mobile-deploy.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mobile-deploy.yml b/.github/workflows/mobile-deploy.yml index bb1ca4f76..5e3ae1c14 100644 --- a/.github/workflows/mobile-deploy.yml +++ b/.github/workflows/mobile-deploy.yml @@ -150,9 +150,16 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + # Guard against auto-closed PRs (GitHub reports merged == false when a PR closes without merging) if: | - (github.event_name != 'pull_request' || github.event.pull_request.merged == true) && - !contains(github.event.pull_request.labels.*.name, 'deploy:skip') + ( + github.event_name != 'pull_request' || + (github.event.action == 'closed' && github.event.pull_request.merged == true) + ) && + ( + github.event_name != 'pull_request' || + !contains(github.event.pull_request.labels.*.name, 'deploy:skip') + ) outputs: version: ${{ steps.bump.outputs.version }} ios_build: ${{ steps.bump.outputs.ios_build }} @@ -262,7 +269,8 @@ jobs: contents: read actions: write if: | - (github.event_name != 'pull_request' || github.event.pull_request.merged == true) && + (github.event_name != 'pull_request' || + (github.event.action == 'closed' && github.event.pull_request.merged == true)) && ( (inputs.platform == 'ios' || inputs.platform == 'both') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'deploy:android')) @@ -829,7 +837,8 @@ jobs: actions: write id-token: write if: | - (github.event_name != 'pull_request' || github.event.pull_request.merged == true) && + (github.event_name != 'pull_request' || + (github.event.action == 'closed' && github.event.pull_request.merged == true)) && ( (inputs.platform == 'android' || inputs.platform == 'both') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'deploy:ios')) @@ -1241,7 +1250,8 @@ jobs: needs: [bump-version, build-ios, build-android] if: | always() && - (github.event_name != 'pull_request' || github.event.pull_request.merged == true) && + (github.event_name != 'pull_request' || + (github.event.action == 'closed' && github.event.pull_request.merged == true)) && (needs.build-ios.result == 'success' || needs.build-android.result == 'success') env: APP_PATH: ${{ github.workspace }}/app