Conversation
📝 WalkthroughWalkthroughA new GitHub Actions job, ChangesiOS / tvOS Build Number Automation
Sequence DiagramsequenceDiagram
participant GHA as GitHub Actions (release.yml)
participant JWT as JWT Generator (cryptography step)
participant ASC as App Store Connect API
participant Gate as Gate/Finalize (testflight.yml)
participant BuildWF as Reusable Build Workflow (build-upload*.yml)
GHA->>JWT: decode key & generate ES256 JWT
GHA->>ASC: GET /v1/builds?filter[app]=APP_ID_IOS&filter[preReleaseVersion]=VERSION
ASC-->>GHA: latest iOS build JSON
GHA->>ASC: GET /v1/builds?filter[app]=APP_ID_TVOS&filter[preReleaseVersion]=VERSION
ASC-->>GHA: latest tvOS build JSON
GHA->>GHA: parse attributes.version, compute next build-number and build-number-tvos
GHA->>Gate: export build-number outputs
GHA->>BuildWF: invoke reusable workflows with ref, version, build-number(s)
BuildWF->>BuildWF: run export/upload step only if inputs.upload == true
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 64-67: The shell assignment for NEXT can become empty because the
python one-liner only prints on the true branch; update the python call so it
always prints a value (or fails loudly) — e.g., replace the current python3 -c
"v='$LATEST'; print(int(v)+1) if v.isdigit() else '1'" with a command that
always prints like python3 -c "v='$LATEST'; print(str(int(v)+1) if v.isdigit()
else '1')" (or alternatively explicitly validate LATEST and exit non‑zero to
fail loudly); ensure this fixes NEXT being empty and that the downstream
build-number no longer receives an empty string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 06182eae-392d-4f78-a540-48e23278be0e
📒 Files selected for processing (1)
.github/workflows/release.yml
|
/testFlight |
|
/testflight |
1 similar comment
|
/testflight |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/release.yml (1)
64-67:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMake the fallback branch print a value.
The current one-liner only prints on the
isdigit()branch, so any non-digitLATESTmakesNEXTempty instead of"1". That silently bypasses the App Store-derived fallback logic.Suggested fix
- NEXT=$(python3 -c "v='$LATEST'; print(int(v)+1) if v.isdigit() else '1'") + NEXT=$(python3 - "$LATEST" <<'PY' +import sys + +v = sys.argv[1] +print(int(v) + 1 if v.isdigit() else 1) +PY + )#!/bin/bash set -euo pipefail python3 <<'PY' import subprocess for v in ["7", "1.2", "none"]: cmd = ["python3", "-c", f"v='{v}'; print(int(v)+1) if v.isdigit() else '1'"] out = subprocess.run(cmd, capture_output=True, text=True, check=True) print(f"{v!r} -> stdout={out.stdout.strip()!r}") PYExpected result:
"1.2"and"none"currently produce empty stdout, confirming thatNEXTcan become empty.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml around lines 64 - 67, The python one-liner that sets NEXT from LATEST only prints when v.isdigit(), leaving NEXT empty for non-digit LATEST values; update the command used to compute NEXT (the python3 -c "v='$LATEST'...") to ensure the else branch prints a value, e.g. replace print(int(v)+1) if v.isdigit() else '1' with a single print that covers both branches such as print(int(v)+1 if v.isdigit() else 1) so NEXT is always assigned (refer to the NEXT and LATEST variables and the python3 -c invocation).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 37-38: The fetch-build-number job currently queries only
APP_STORE_APP_ID_IOS and its output is reused for tvOS, which can mismatch; add
a new secret (e.g., APP_STORE_APP_ID_TVOS) and create a new job
fetch-build-number-tvos that mirrors fetch-build-number but uses
APP_STORE_APP_ID_TVOS, run it before build-tvos, and have build-tvos consume the
tvOS-specific build number output instead of the iOS output; update references
in the workflow (jobs: fetch-build-number, fetch-build-number-tvos, build-tvos)
so tvOS uses the new job output.
---
Duplicate comments:
In @.github/workflows/release.yml:
- Around line 64-67: The python one-liner that sets NEXT from LATEST only prints
when v.isdigit(), leaving NEXT empty for non-digit LATEST values; update the
command used to compute NEXT (the python3 -c "v='$LATEST'...") to ensure the
else branch prints a value, e.g. replace print(int(v)+1) if v.isdigit() else '1'
with a single print that covers both branches such as print(int(v)+1 if
v.isdigit() else 1) so NEXT is always assigned (refer to the NEXT and LATEST
variables and the python3 -c invocation).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d569c814-4c08-4c52-9fd2-66d6bc7471f4
📒 Files selected for processing (3)
.github/workflows/build-upload-tvos.yml.github/workflows/build-upload.yml.github/workflows/release.yml
✅ Files skipped from review due to trivial changes (1)
- .github/workflows/build-upload.yml
|
TestFlight builds uploaded |
|
/testflight |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/testflight.yml (1)
286-363:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winNotify messages only surface the iOS build number, now that iOS and tvOS builds diverge.
Both
notify(Line 295, 309, 312) andnotify-merge(Line 339, 355) construct their messages using onlyneeds.gate.outputs.build-number(the iOS build number). Since this PR intentionally gives tvOS its own independent build number (build-number-tvos), the commit/PR comment will silently show the iOS number for both platforms, making it hard to cross-reference the correct tvOS build in App Store Connect.💬 Suggested fix for
notifyandnotify-mergeIn the
notifyjob, expose the tvOS build number alongside the iOS one:const buildNumber = '${{ needs.gate.outputs.build-number }}'; + const buildNumberTvos = '${{ needs.gate.outputs.build-number-tvos }}'; const version = '${{ needs.gate.outputs.version }}';Then update the success message body:
- body = `**TestFlight builds uploaded** \`${version} (${buildNumber})\` for \`${shortSha}\` — iOS + tvOS\n\n[View workflow run](${runUrl})`; + body = `**TestFlight builds uploaded** \`${version}\` for \`${shortSha}\` — iOS (${buildNumber}) + tvOS (${buildNumberTvos})\n\n[View workflow run](${runUrl})`;Apply the same pattern to
notify-merge:const version = process.env.VERSION; const buildNumber = process.env.BUILD_NUMBER; + const buildNumberTvos = '${{ needs.gate.outputs.build-number-tvos }}'; ... - const body = `**TestFlight** \`${version} (${buildNumber})\` — iOS ${iosBadge} tvOS ${tvosBadge}\n\n[View workflow run](${runUrl})`; + const body = `**TestFlight** \`${version}\` — iOS ${iosBadge} (${buildNumber}) tvOS ${tvosBadge} (${buildNumberTvos})\n\n[View workflow run](${runUrl})`;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/testflight.yml around lines 286 - 363, The notify and notify-merge steps currently only surface the iOS build number (needs.gate.outputs.build-number / BUILD_NUMBER) but tvOS has a separate build number (needs.gate.outputs.build-number-tvos); update both jobs to read and expose the tvOS build number: in the notify job add build-number-tvos to the interpolated inputs and create a const buildNumberTvos (from needs.gate.outputs.build-number-tvos) and include it in the PR comment body alongside buildNumber (e.g., show `iOS: <buildNumber> tvOS: <buildNumberTvos>`); do the same in notify-merge by adding BUILD_NUMBER_TVOS to env, reading process.env.BUILD_NUMBER_TVOS into a buildNumberTvos const and include it in the commit comment body so both platforms’ build numbers are clearly shown.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/testflight.yml:
- Around line 286-363: The notify and notify-merge steps currently only surface
the iOS build number (needs.gate.outputs.build-number / BUILD_NUMBER) but tvOS
has a separate build number (needs.gate.outputs.build-number-tvos); update both
jobs to read and expose the tvOS build number: in the notify job add
build-number-tvos to the interpolated inputs and create a const buildNumberTvos
(from needs.gate.outputs.build-number-tvos) and include it in the PR comment
body alongside buildNumber (e.g., show `iOS: <buildNumber> tvOS:
<buildNumberTvos>`); do the same in notify-merge by adding BUILD_NUMBER_TVOS to
env, reading process.env.BUILD_NUMBER_TVOS into a buildNumberTvos const and
include it in the commit comment body so both platforms’ build numbers are
clearly shown.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a789917e-6514-4c65-83f7-b1f4bb5b5e4e
📒 Files selected for processing (3)
.github/workflows/build-upload-tvos.yml.github/workflows/release.yml.github/workflows/testflight.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/release.yml
Description
Release workflow now fetches the latest build number from App Store Connect before building
Build number is automatically set to latest + 1 for the release version derived from the git tag
Falls back to 1 if no builds exist yet for that version
Consistent with the same logic already in testflight.yml
Added APP_STORE_APP_ID_TVOS secret support to fetch tvOS build number independently from iOS
tvOS and iOS now each query App Store Connect separately and get their own latest + 1 build number
Fixed tvOS not receiving the correct MARKETING_VERSION — now passed via new version input in build-upload-tvos.yml
Added tvOS build to release.yml (was missing entirely)
Fixed if: inputs.upload → if: inputs.upload == true in both build workflows to ensure upload step is not skipped
Summary by CodeRabbit