diff --git a/.github/workflows/verify-public-interface.yml b/.github/workflows/verify-public-interface.yml index b4f607957ff..0af0626a3db 100644 --- a/.github/workflows/verify-public-interface.yml +++ b/.github/workflows/verify-public-interface.yml @@ -19,7 +19,14 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + + - name: Checkout through merge base + uses: rmacklin/fetch-through-merge-base@v0 + with: + base_ref: ${{ github.event.pull_request.base.ref }} + head_ref: ${{ github.event.pull_request.head.sha }} + deepen_length: 500 + - name: Build frameworks and compare interfaces id: build-frameworks-compare-interface run: | diff --git a/StripePayments/StripePayments/Source/Internal/API Bindings/STPPaymentMethodListDeserializer.swift b/StripePayments/StripePayments/Source/Internal/API Bindings/STPPaymentMethodListDeserializer.swift index 431782da509..79934df5d12 100644 --- a/StripePayments/StripePayments/Source/Internal/API Bindings/STPPaymentMethodListDeserializer.swift +++ b/StripePayments/StripePayments/Source/Internal/API Bindings/STPPaymentMethodListDeserializer.swift @@ -38,6 +38,7 @@ import Foundation paymentMethods.append(paymentMethod) } } + // Modify Swift file to trigger CI paymentMethodsDeserializer.paymentMethods = paymentMethods return paymentMethodsDeserializer } diff --git a/ci_scripts/api_diff/build_xcframeworks.rb b/ci_scripts/api_diff/build_xcframeworks.rb index e1144b4b9e8..8cee0ca8ee4 100644 --- a/ci_scripts/api_diff/build_xcframeworks.rb +++ b/ci_scripts/api_diff/build_xcframeworks.rb @@ -6,7 +6,13 @@ def checkout_build_generate(branch, archive_name) # Checkout old or new version, build and generate API JSON puts "Building and generating public interface from #{branch}..." - system("git checkout #{branch}") + if archive_name == "master" + head_ref = ENV['GITHUB_HEAD_REF'] + commit_sha = system("git merge-base #{branch} #{head_ref}") + system("git checkout #{commit_sha}") + else + system("git checkout #{branch}") + end system("xcodebuild clean archive \ -quiet \ @@ -30,5 +36,5 @@ def checkout_build_generate(branch, archive_name) end # Run function for master and head_ref -checkout_build_generate("master", "master") +checkout_build_generate(ENV["GITHUB_BASE_REF"], "master") checkout_build_generate(ENV['GITHUB_HEAD_REF'], "new") \ No newline at end of file