Skip to content

fix(ci): skip Fastlane versionCode lookup for PR builds#159

Closed
TimeToBuildBob wants to merge 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/versioncode-pr-fallback
Closed

fix(ci): skip Fastlane versionCode lookup for PR builds#159
TimeToBuildBob wants to merge 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/versioncode-pr-fallback

Conversation

@TimeToBuildBob
Copy link
Copy Markdown
Contributor

Problem

The get-versionCode CI job requires the KEY_FASTLANE_API secret to decrypt the Google Play API key. This secret is not available to fork PRs (GitHub's security model), so the job fails at the Load Fastlane secrets step. 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 fastlane
  • adnsio/setup-age-action
  • Load Fastlane secrets
  • Update versionCode

For PR builds, those steps are skipped. The job falls through to the Output versionCode step, which reads the current versionCode directly from mobile/build.gradle. This is already the approach used by build-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

  • PR builds: get-versionCode skips Fastlane, reads versionCode 34 (or whatever's in build.gradle) and passes
  • Master/tag builds: unchanged — still runs bundle exec fastlane update_version

Closes the CI blocker reported in #139 and noted in #156.

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-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR fixes a CI blocker for fork PRs by skipping the four Fastlane-dependent steps in the get-versionCode job when the trigger is a pull_request event. Fork PRs cannot access the KEY_FASTLANE_API secret, so those steps previously failed; now they are skipped and the job falls through to the existing Output versionCode step which reads the version directly from mobile/build.gradle.

  • if: github.event_name != 'pull_request' is added to Set up Ruby and install fastlane, adnsio/setup-age-action, Load Fastlane secrets, and Update versionCode — the only steps that need the Play Store API key.
  • Master-branch and tag builds are completely unaffected and continue to run the full Fastlane version-increment flow.

Confidence Score: 5/5

Safe 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 push, not pull_request. The Output versionCode step that reads from mobile/build.gradle was already present and is the correct fallback for PR builds.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/build.yml Adds if: github.event_name != 'pull_request' guards to four Fastlane-dependent steps in get-versionCode, letting fork PR builds fall through to the existing Output versionCode step that reads directly from mobile/build.gradle.

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]
Loading

Reviews (1): Last reviewed commit: "fix(ci): skip Fastlane versionCode looku..." | Re-trigger Greptile

@TimeToBuildBob
Copy link
Copy Markdown
Contributor Author

Closing this as superseded by #158. #158 includes this fork versionCode fix plus the Rust 1.79.0 pin needed for the current build-rust failure, so keeping both PRs open would just split the CI discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant