fix(ci): skip Fastlane versionCode lookup for PR builds#159
fix(ci): skip Fastlane versionCode lookup for PR builds#159TimeToBuildBob wants to merge 1 commit into
Conversation
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.
Greptile SummaryThis PR fixes a CI blocker for fork PRs by skipping the four Fastlane-dependent steps in the
Confidence Score: 5/5Safe to merge — the change is minimal, isolated to CI, and does not affect release builds or application code. The four skipped steps are all in a single job and are strictly additive guards on a pre-existing fallback path. Master-branch and tag builds are untouched because their trigger is No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[get-versionCode job starts] --> B{github.event_name == 'pull_request'?}
B -- Yes (fork PR / PR build) --> E[SKIP: Set up Ruby & Fastlane]
B -- No (push to master / tag) --> C[Set up Ruby & install Fastlane]
E --> F[SKIP: setup-age-action]
F --> G[SKIP: Load Fastlane secrets]
G --> H[SKIP: Update versionCode via Play Store API]
C --> C2[setup-age-action]
C2 --> C3[Load Fastlane secrets KEY_FASTLANE_API]
C3 --> C4[Update versionCode via fastlane update_version]
C4 --> I
H --> I[Output versionCode - read from mobile/build.gradle]
I --> J[versionCode output passed to build-apk job]
Reviews (1): Last reviewed commit: "fix(ci): skip Fastlane versionCode looku..." | Re-trigger Greptile |
Problem
The
get-versionCodeCI job requires theKEY_FASTLANE_APIsecret to decrypt the Google Play API key. This secret is not available to fork PRs (GitHub's security model), so the job fails at theLoad Fastlane secretsstep. This blocks CI for all pull requests from forks.Fix
Add
if: github.event_name != 'pull_request'to all Fastlane-dependent steps:Set up Ruby and install fastlaneadnsio/setup-age-actionLoad Fastlane secretsUpdate versionCodeFor PR builds, those steps are skipped. The job falls through to the
Output versionCodestep, which reads the current versionCode directly frommobile/build.gradle. This is already the approach used bybuild-only.yml.The real Play Store versionCode increment only matters for release builds (master branch and tag pushes), which still run the full Fastlane flow.
Verification
get-versionCodeskips Fastlane, readsversionCode 34(or whatever's in build.gradle) and passesbundle exec fastlane update_versionCloses the CI blocker reported in #139 and noted in #156.