diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index a51cf6f..52aa8de 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -1,10 +1,11 @@ name: iOS TestFlight on: - push: - tags: - - "qa-*" - workflow_dispatch: + pull_request: + types: + - closed + branches: + - develop env: SCHEME: DevLog @@ -24,12 +25,15 @@ permissions: jobs: testflight: + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop' && (contains(github.event.pull_request.labels.*.name, 'qa') || contains(github.event.pull_request.labels.*.name, 'qa-local')) runs-on: macos-latest timeout-minutes: 45 steps: - - name: Checkout + - name: Checkout merge commit uses: actions/checkout@v5 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Install private config files uses: ./.github/actions/install-private-config @@ -74,10 +78,10 @@ jobs: - name: Build for TestFlight run: bundle exec fastlane testflight_build_only - - name: Skip TestFlight Upload for Local QA Tag - if: github.event_name == 'push' && startsWith(github.ref_name, 'qa-local-') - run: echo "Skipping TestFlight upload for local QA tag ${GITHUB_REF_NAME}" + - name: Skip TestFlight Upload for Local QA Label + if: contains(github.event.pull_request.labels.*.name, 'qa-local') + run: echo "Skipping TestFlight upload for PR labeled qa-local" - name: Upload to TestFlight - if: github.event_name != 'push' || !startsWith(github.ref_name, 'qa-local-') + if: contains(github.event.pull_request.labels.*.name, 'qa') && !contains(github.event.pull_request.labels.*.name, 'qa-local') run: bundle exec fastlane upload_testflight_build