From 027e3fea9b9edd24a5ed170a259dc3a6339bd4ed Mon Sep 17 00:00:00 2001 From: Bob Date: Thu, 21 May 2026 19:53:41 +0000 Subject: [PATCH] fix(ci): skip Fastlane versionCode lookup for PR builds PR builds (especially from forks) don't have access to KEY_FASTLANE_API, causing the get-versionCode job to fail at 'Load Fastlane secrets'. Add 'if: github.event_name != pull_request' to the Ruby/Fastlane setup, secrets loading, and update_version steps. For PRs the job falls through to the Output step, which reads versionCode directly from mobile/build.gradle. This matches the simpler approach already used in build-only.yml. The real Play Store versionCode is only needed for release builds. --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d735f8d5..575d0c89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,16 +99,23 @@ jobs: submodules: 'recursive' - # Ruby & Fastlane + # Ruby & Fastlane — only needed for non-PR builds. + # PRs (especially from forks) don't have access to KEY_FASTLANE_API, so + # they fall through to the Output step which reads the current versionCode + # directly from mobile/build.gradle. This is fine for build verification; + # the real Play Store versionCode is only needed for release builds. # version set by .ruby-version - name: Set up Ruby and install fastlane + if: github.event_name != 'pull_request' uses: ruby/setup-ruby@v1 with: bundler-cache: true # Needed for `fastlane update_version` - uses: adnsio/setup-age-action@v1.2.0 + if: github.event_name != 'pull_request' - name: Load Fastlane secrets + if: github.event_name != 'pull_request' env: KEY_FASTLANE_API: ${{ secrets.KEY_FASTLANE_API }} run: | @@ -121,6 +128,7 @@ jobs: # Retry this, in case there are concurrent jobs, which may lead to the error: # "Google Api Error: Invalid request - This Edit has been deleted." - name: Update versionCode + if: github.event_name != 'pull_request' uses: Wandalen/wretry.action@master with: command: bundle exec fastlane update_version