Skip to content

Commit

Permalink
Make it work like the translations script
Browse files Browse the repository at this point in the history
  • Loading branch information
porter-stripe committed Apr 12, 2024
1 parent de9d5f4 commit 04a3eae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/verify-public-interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,22 @@ jobs:
echo "Generating public interface diff..."
touch diff.txt
ruby ci_scripts/diff_public_interface.rb \
StripePaymentSheet-master.xcframework/ios-arm64_x86_64-simulator/StripePaymentSheet.framework/Modules/StripePaymentSheet.swiftmodule/x86_64-apple-ios-simulator.abi.json \
StripePaymentSheet-new.xcframework/ios-arm64_x86_64-simulator/StripePaymentSheet.framework/Modules/StripePaymentSheet.swiftmodule/x86_64-apple-ios-simulator.abi.json > diff.txt
echo "API_DIFF=$API_DIFF" >> $GITHUB_ENV
- name: Set API_DIFF if changes exist
- name: Read public interface changes
id: public-api-diff
run: echo "::set-output name=diff::$(<diff_result.txt)"

- name: Exit if no public API changes
id: check_diff
run: |
if [[ -s diff.txt ]]; then
output=$(cat diff.txt)
echo "API_DIFF=$output" >> $GITHUB_ENV
echo "::set-output name=new_apis_detected::yes"
if [ -z "${{ steps.public-api-diff.outputs.diff }}" ]; then
echo "No public API changes detected, exiting..."
exit 0
else
echo "::set-output name=new_apis_detected::"
echo "Public API changes detected, continue workflow..."
fi
- uses: peter-evans/find-comment@v1
Expand Down
6 changes: 5 additions & 1 deletion ci_scripts/diff_public_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ def diff(old_path, new_path)
exit
end

puts diff(ARGV[0], ARGV[1])
diff_result = diff(ARGV[0], ARGV[1])

if !diff_result.empty?
File.open("diff_result.txt", 'w') { |f| f.write diff_result }
end

0 comments on commit 04a3eae

Please sign in to comment.