Skip to content

Revives update-paywall-templates workflow#3585

Merged
JayShortway merged 2 commits into
mainfrom
cursor/fix-paywall-submodule-pr-automation-7727
Jun 11, 2026
Merged

Revives update-paywall-templates workflow#3585
JayShortway merged 2 commits into
mainfrom
cursor/fix-paywall-submodule-pr-automation-7727

Conversation

@JayShortway

@JayShortway JayShortway commented Jun 11, 2026

Copy link
Copy Markdown
Member

Description

The update_paywall_preview_resources_submodule lane has been failing since November, meaning the paywall-preview-resources submodule didn't get updated. Here's the latest failure.

Cause

Fastfile:43:in `run_plugin_action_in_current_directory': undefined method `chomp' for nil:NilClass (NoMethodError)

This broke in #2858 when I added run_plugin_action_in_current_directory. This crashes when the directory has no subdirectories.

Fix

Make run_plugin_action_in_current_directory fall back to running the action directly when there are no subdirectories.

Open in Web Open in Cursor 

Note

Low Risk
Small defensive change to CI-only Fastlane directory workaround; no app or SDK runtime impact.

Overview
Fixes run_plugin_action_in_current_directory in the Fastfile so automated lanes no longer crash when the current working directory has no subdirectories.

Previously the helper always called Dir["*/"].first.chomp("/"), which raised NoMethodError when .first was nil—breaking CI jobs such as update_paywall_preview_resources_submodule (and the update-paywall-templates workflow) since November.

The change stores the first subdirectory in a variable and, if it is missing, invokes the block in place instead of chdiring; otherwise behavior is unchanged. A comment about the old limitation was removed.

Reviewed by Cursor Bugbot for commit 8b2dfea. Bugbot is set up for automated code reviews on this repo. Configure here.

… PR creation

run_plugin_action_in_current_directory raised "undefined method 'chomp'
for nil:NilClass" whenever the current working directory had no
subdirectories (the ./fastlane directory). This silently broke the
update_paywall_preview_resources_submodule lane after #2858: the commit
and push succeeded, but PR creation crashed, so the submodule was never
updated on main while the recurring branch kept accumulating commits.

Fall back to running the plugin action directly when there is no
subdirectory to switch into, which is correct when the working directory
is ./fastlane (Fastlane already runs plugin actions from the repo root).

Co-authored-by: joop <joop@revenuecat.com>
@JayShortway JayShortway self-assigned this Jun 11, 2026
@JayShortway JayShortway changed the title Fix paywall-preview-resources submodule auto-update crashing on PR creation Revives update-paywall-templates workflow Jun 11, 2026
@JayShortway JayShortway requested review from a team June 11, 2026 10:14
@JayShortway JayShortway marked this pull request as ready for review June 11, 2026 10:14
@JayShortway JayShortway requested a review from a team as a code owner June 11, 2026 10:14

@ajpallares ajpallares left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I think the same fix is needed in iOS?

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.35%. Comparing base (20bcdf6) to head (8b2dfea).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3585   +/-   ##
=======================================
  Coverage   80.35%   80.35%           
=======================================
  Files         377      377           
  Lines       15417    15417           
  Branches     2140     2140           
=======================================
  Hits        12389    12389           
  Misses       2171     2171           
  Partials      857      857           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JayShortway

Copy link
Copy Markdown
Member Author

@ajpallares You're right! The bug doesn't surface in iOS because it has a subdirectory, but the bug is there.

RevenueCat/purchases-ios#6976

@JayShortway JayShortway added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit 1b5a96c Jun 11, 2026
38 checks passed
@JayShortway JayShortway deleted the cursor/fix-paywall-submodule-pr-automation-7727 branch June 11, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants