From 71257041a22418c7fd054f7459b9fdbc91295d56 Mon Sep 17 00:00:00 2001
From: Jan Nowakowski <janeknowakowski9@gmail.com>
Date: Wed, 22 Jan 2025 17:06:21 +0100
Subject: [PATCH 1/5] Do not skip build jobs if no OD PR is mentioned

---
 .github/workflows/testBuildHybrid.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/testBuildHybrid.yml b/.github/workflows/testBuildHybrid.yml
index db40942316b1..cd32376a0dba 100644
--- a/.github/workflows/testBuildHybrid.yml
+++ b/.github/workflows/testBuildHybrid.yml
@@ -89,7 +89,6 @@ jobs:
   getOldDotBranchRef:
       runs-on: ubuntu-latest
       needs: getOldDotPR
-      if: ${{ needs.getOldDotPR.outputs.OLD_DOT_PR != '' }}
       outputs:
         OLD_DOT_REF: ${{ steps.getHeadRef.outputs.REF }}
       steps:
@@ -100,7 +99,11 @@ jobs:
           id: getHeadRef
           run: |
             set -e
-            echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R 'Expensify/Mobile-Expensify' --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
+            if [[ ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} == '' ]]; then
+              echo "REF=" >> "$GITHUB_OUTPUT"
+            else
+              echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R Expensify/Mobile-Expensify --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
+            fi
           env:
             GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   

From 55fb363ec055c4b238746f1054e57e9162fb58dd Mon Sep 17 00:00:00 2001
From: Jan Nowakowski <janeknowakowski9@gmail.com>
Date: Thu, 23 Jan 2025 14:30:09 +0100
Subject: [PATCH 2/5] Use different token

---
 .github/workflows/testBuildHybrid.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/testBuildHybrid.yml b/.github/workflows/testBuildHybrid.yml
index cd32376a0dba..8d896329fe74 100644
--- a/.github/workflows/testBuildHybrid.yml
+++ b/.github/workflows/testBuildHybrid.yml
@@ -105,7 +105,7 @@ jobs:
               echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R Expensify/Mobile-Expensify --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
             fi
           env:
-            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+            GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
   
 
   postGitHubCommentBuildStarted:

From 183834fdf64cec4b8b7da9bc74ceafa8b5dbb26a Mon Sep 17 00:00:00 2001
From: Jan Nowakowski <janeknowakowski9@gmail.com>
Date: Thu, 23 Jan 2025 15:41:58 +0100
Subject: [PATCH 3/5] Fetch PR ref before checkout

---
 .github/workflows/testBuildHybrid.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/testBuildHybrid.yml b/.github/workflows/testBuildHybrid.yml
index 8d896329fe74..7ed0ed2c54fa 100644
--- a/.github/workflows/testBuildHybrid.yml
+++ b/.github/workflows/testBuildHybrid.yml
@@ -151,7 +151,7 @@ jobs:
         if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
         run: |
           cd Mobile-Expensify
-          git fetch
+          git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
           git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
       
       - name: Configure MapBox SDK

From a8b29a35669d6eb8126d0fce79fa89a8de04a0ef Mon Sep 17 00:00:00 2001
From: Jan Nowakowski <janeknowakowski9@gmail.com>
Date: Fri, 24 Jan 2025 08:46:06 +0100
Subject: [PATCH 4/5] Use adhoc scheme

---
 fastlane/Fastfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index 806ffe574031..a83ef268b7aa 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -437,7 +437,7 @@ platform :ios do
 
       build_app(
         workspace: "Mobile-Expensify/iOS/Expensify.xcworkspace",
-        scheme: "Expensify",
+        scheme: "Expensify AdHoc",
         output_name: "Expensify.ipa",
         export_method: "app-store",
         export_options: {

From d1c506713bad5bc94cb3a577a7784458d87b54b3 Mon Sep 17 00:00:00 2001
From: Jan Nowakowski <janeknowakowski9@gmail.com>
Date: Fri, 24 Jan 2025 08:51:20 +0100
Subject: [PATCH 5/5] Read op files

---
 .github/workflows/testBuildHybrid.yml | 8 ++++----
 fastlane/Fastfile                     | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/testBuildHybrid.yml b/.github/workflows/testBuildHybrid.yml
index 7ed0ed2c54fa..bfb2cd34c558 100644
--- a/.github/workflows/testBuildHybrid.yml
+++ b/.github/workflows/testBuildHybrid.yml
@@ -262,7 +262,7 @@ jobs:
         if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
         run: |
           cd Mobile-Expensify
-          git fetch
+          git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
           git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
 
       - name: Configure MapBox SDK
@@ -314,9 +314,9 @@ jobs:
         env:
           OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
         run: |
-          op document get --output ./OldApp_AdHoc.mobileprovision OldApp_AdHoc
-          op document get --output ./OldApp_AdHoc_Share_Extension.mobileprovision OldApp_AdHoc_Share_Extension
-          op document get --output ./OldApp_AdHoc_Notification_Service.mobileprovision OldApp_AdHoc_Notification_Service
+          op read op://Mobile-Deploy-CI/OldApp_AdHoc/OldApp_AdHoc.mobileprovision --force --out-file ./OldApp_AdHoc.mobileprovision
+          op read op://Mobile-Deploy-CI/OldApp_AdHoc_Share_Extension/OldApp_AdHoc_Share_Extension.mobileprovision --force --out-file ./OldApp_AdHoc_Share_Extension.mobileprovision
+          op read op://Mobile-Deploy-CI/OldApp_AdHoc_Notification_Service/OldApp_AdHoc_Notification_Service.mobileprovision --force --out-file ./OldApp_AdHoc_Notification_Service.mobileprovision
 
       - name: Decrypt certificate
         run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index a83ef268b7aa..8747a535007e 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -443,9 +443,9 @@ platform :ios do
         export_options: {
           manageAppVersionAndBuildNumber: false,
           provisioningProfiles: {
-              "com.expensify.expensifylite.adhoc" => "(OldApp) AppStore",
-              "com.expensify.expensifylite.adhoc.SmartScanExtension" => "(OldApp) AppStore: Share Extension",
-              "com.expensify.expensifylite.adhoc.NotificationServiceExtension" => "(OldApp) AppStore: Notification Service",
+              "com.expensify.expensifylite.adhoc" => "(OldApp) AdHoc",
+              "com.expensify.expensifylite.adhoc.SmartScanExtension" => "(OldApp) AdHoc: Share Extension",
+              "com.expensify.expensifylite.adhoc.NotificationServiceExtension" => "(OldApp) AdHoc: Notification Service",
           }
         }
       )
