Skip to content

iOSとAndroidのCanary・Productionビルドワークフローを整備 - #6513

Merged
TinyKitten merged 8 commits into
devfrom
feature/ios-build-workflow
Aug 3, 2026
Merged

TinyKitten merged 8 commits into
devfrom
feature/ios-build-workflow

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

概要

iOS と Android のビルドを Canary / Production ごとの独立した GitHub Actions ワークフローとして整備します。ビルド種別をブランチ名から推測せず、任意のブランチから目的のワークフローを手動実行できます。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • iOS Canary、iOS Production、Android Canary、Android Production の4ワークフローへ分割しました。
  • Canary は canary、Production は master への push で自動実行します。
  • すべて workflow_dispatch にも対応し、選択した任意の ref から明示的に実行できます。
  • Canary は staging / development API と開発用アプリ識別子、Production は production API と本番用アプリ識別子へ固定しました。
  • iOS は Xcode archive、TestFlight upload、dSYM artifact 保存、終了時の signing credentials 削除を行います。
  • iOS の手動実行は TestFlight 配信なしを既定とし、署名・archive を安全にdry-runできます。
  • Android は AAB artifact を保存し、手動入力に応じて Google Play internal track へアップロードします。手動実行ではアップロードなしを既定にしました。
  • 両プラットフォームの Node.js バージョンをリポジトリ標準の22へ統一しました。
  • SSH Agentを検証済みcommitへ固定し、Android署名ファイルの権限を0600へ制限しました。
  • setup-gradleとupload-google-playを検証済みcommitへ固定し、tracks入力へ移行しました。
  • iOS再実行時のbuild numberを一意にし、署名鍵のアクセス先をcodesignへ限定しました。
  • iOS / Androidビルドの前提条件、必要なsecrets、dry-run手順を文書化しました。

影響とリスク

  • アプリ本体のランタイム動作に変更はありません。
  • canary / master への push では対応する variant が自動実行され、手動実行時はブランチに依存せずワークフローを選択できます。
  • GitHub Actions secrets、Apple / Android signing 設定、各 runner の利用可否に依存します。
  • variant ごとに環境変数、scheme / Gradle task、package name を固定し、誤った組み合わせでの配信リスクを抑えています。
  • 手動iOSビルドは明示的に有効化しない限りTestFlightへ配信されません。
  • 手動Androidビルドも明示的に有効化しない限りGoogle Playへ配信されません。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

実行結果:

  • 4ワークフローの YAML 構文解析: 成功
  • npx --yes markdownlint-cli2 docs/android-build-workflows.md docs/ios-build-workflows.md: 成功
  • git diff --check: 成功
  • npm run lint: 成功(604 files)
  • npm test -- --runInBand: 成功(201 suites、2169 tests)
  • npm run typecheck: 成功

actionlint はローカル環境に未導入のため未実行です。実際の archive / upload は GitHub Actions secrets と各 runner が必要なため、Actions 上で確認します。

関連Issue

なし

スクリーンショット(任意)

UI 変更なし

@TinyKitten TinyKitten self-assigned this Aug 3, 2026
@github-actions github-actions Bot added the ci/cd label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Android Canaryワークフローを追加し、本番ワークフローを本番専用に固定しました。iOS Canaryおよび本番ワークフローを追加しました。各ワークフローで依存関係、署名、ビルド、成果物保存、配布、資格情報削除を構成します。

Changes

モバイルビルドパイプライン

Layer / File(s) Summary
Android Canaryビルドと配布
.github/workflows/build_android_canary.yml
canary pushまたは手動実行で、環境を検証してdevRelease AABをビルドします。署名情報を復元し、条件に応じてGoogle Play internalトラックへ配布します。
Android本番ビルドと配布
.github/workflows/build_android_production.yml
master pushまたは手動実行で、prodRelease AABをビルドします。本番環境変数、成果物、Google Play配布先を固定します。
iOS環境と署名の準備
.github/workflows/build_ios_canary.yml, .github/workflows/build_ios_production.yml
依存関係、Sentry設定、App Store Connect秘密鍵、配布証明書、一時キーチェーンを構成します。必須環境変数を検証します。
iOSアーカイブとTestFlight配布
.github/workflows/build_ios_canary.yml, .github/workflows/build_ios_production.yml, docs/ios-build-workflows.md
iOSアーカイブを作成し、条件に応じてTestFlightへアップロードします。dSYMを保存し、終了時に一時資格情報を削除します。手動実行とpush実行の条件を文書化します。

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant BuildTools
  participant GooglePlay
  participant AppStoreConnect
  GitHubActions->>BuildTools: 依存関係と署名情報を準備
  GitHubActions->>BuildTools: Android AABまたはiOSアーカイブを生成
  BuildTools->>GooglePlay: Android AABとmappingをinternalへアップロード
  BuildTools->>AppStoreConnect: iOSアーカイブをTestFlightへアップロード
Loading

Possibly related PRs

  • TrainLCD/MobileApp#6446: GitHub Actionsへのモバイルビルド移行とAndroidのsecret・Gradle設定に関連します。
  • TrainLCD/MobileApp#6456: AndroidのGoogle Play internalトラックへの条件付きアップロードに関連します。

Suggested labels: ios

Poem

うさぎは鍵をそっとしまう
CanaryのAABが跳ねる
iOSのdSYMを巣に置く
TestFlightへ羽ばたいて
成功後も秘密を消す

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed iOSとAndroidのCanary・Productionビルドワークフローを整備する主要変更を明確に示しています。
Description check ✅ Passed 概要、変更内容、テスト結果、関連Issue、影響とリスクを記載し、テンプレートの必須項目をほぼ満たしています。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ios-build-workflow

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/build_ios.yml (2)

190-208: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

run:内のテンプレート展開をenv:経由に統一する。

Line 199の-scheme "${{ steps.build_vars.outputs.scheme }}"とLine 207のCURRENT_PROJECT_VERSION="${{ github.run_number }}"は、run:スクリプト内で直接テンプレート展開しています。zizmorはこのパターンをtemplate-injectionのリスクとして検出します。

このファイルの他のステップ(Line 44-46、118、156-157など)はGitHubコンテキスト値をenv:ブロック経由で渡し、シェル内では環境変数として参照しています。同じパターンに統一し、将来schemeの決定ロジックが外部入力を直接反映するよう変更された場合の防御を強化してください。

🛡️ env経由に統一する修正案
       - name: Archive ${{ steps.build_vars.outputs.variant }}
         env:
           APP_VARIANT: "${{ steps.build_vars.outputs.app_variant }}"
+          BUILD_SCHEME: "${{ steps.build_vars.outputs.scheme }}"
+          PROJECT_VERSION: "${{ github.run_number }}"
           EXPERIMENTAL_TELEMETRY_TOKEN: "${{ secrets.EXPERIMENTAL_TELEMETRY_TOKEN }}"
           API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
           API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
         run: |
           xcodebuild \
             -workspace ios/TrainLCD.xcworkspace \
-            -scheme "${{ steps.build_vars.outputs.scheme }}" \
+            -scheme "$BUILD_SCHEME" \
             -configuration Release \
             -destination 'generic/platform=iOS' \
             -archivePath "$RUNNER_TEMP/TrainLCD.xcarchive" \
             -allowProvisioningUpdates \
             -authenticationKeyPath "$API_KEY_PATH" \
             -authenticationKeyID "$API_KEY_ID" \
             -authenticationKeyIssuerID "$API_ISSUER_ID" \
-            CURRENT_PROJECT_VERSION="${{ github.run_number }}" \
+            CURRENT_PROJECT_VERSION="$PROJECT_VERSION" \
             archive
🤖 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/build_ios.yml around lines 190 - 208,
Archiveステップのrunスクリプト内にあるschemeとCURRENT_PROJECT_VERSIONの直接的なGitHubテンプレート展開を、envブロックで環境変数として定義する形に変更してください。run内のxcodebuildではそれぞれの環境変数を参照し、既存のビルド値と動作を維持してください。

Source: Linters/SAST tools


190-208: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Xcodeのバージョンを明示的に固定する。

macos-26にはXcode 26.6、26.5、26.4.1、26.3、26.2、26.1.1、26.0.1がインストールされています。デフォルトはイメージ更新で変わるため、プロジェクトがサポートするバージョンをxcode-selectで選択してからビルドしてください。

🤖 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/build_ios.yml around lines 190 - 208,
Archiveステップのxcodebuild実行前に、プロジェクトがサポートするXcodeバージョンをxcode-selectで明示的に選択してください。macos-26のデフォルト選択に依存せず、インストール済みの固定バージョンを指定したうえで、既存のArchive
${{ steps.build_vars.outputs.variant }}ビルド処理を実行します。
🤖 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/build_ios.yml:
- Around line 1-40: Add a comment block at the top of the Build iOS workflow
documenting all 16 required secrets from STAGING_API_URL through
IOS_DISTRIBUTION_CERTIFICATE_PASSWORD, along with required environment variables
and service-account setup. Document the macos-26 runner prerequisite, App Store
Connect API key, Apple distribution certificate, and SSH key needed for the
Fonts submodule. Include concise setup steps and a safe dry-run procedure, and
align the documented names and prerequisites with the other CI workflows.
- Around line 169-182: After decoding the distribution certificate in the
workflow block using certificate_path, apply restrictive 600 permissions to the
resulting distribution.p12 file, matching the existing protection used for the
App Store Connect API key before importing it into the keychain.

---

Nitpick comments:
In @.github/workflows/build_ios.yml:
- Around line 190-208:
Archiveステップのrunスクリプト内にあるschemeとCURRENT_PROJECT_VERSIONの直接的なGitHubテンプレート展開を、envブロックで環境変数として定義する形に変更してください。run内のxcodebuildではそれぞれの環境変数を参照し、既存のビルド値と動作を維持してください。
- Around line 190-208:
Archiveステップのxcodebuild実行前に、プロジェクトがサポートするXcodeバージョンをxcode-selectで明示的に選択してください。macos-26のデフォルト選択に依存せず、インストール済みの固定バージョンを指定したうえで、既存のArchive
${{ steps.build_vars.outputs.variant }}ビルド処理を実行します。
🪄 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: 7adc796b-3308-405f-955f-511a9b94893c

📥 Commits

Reviewing files that changed from the base of the PR and between 94e0e6e and 663d9b9.

📒 Files selected for processing (1)
  • .github/workflows/build_ios.yml

Comment thread .github/workflows/build_ios.yml Resolved
@TinyKitten TinyKitten changed the title iOSビルドとTestFlight配信のGitHub Actionsワークフローを追加 iOSとAndroidのCanary・Productionビルドワークフローを整備 Aug 3, 2026
@TinyKitten

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/build_android_canary.yml (2)

77-108: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

署名キーストアと gradle.properties のファイル権限を制限してください。 両ワークフローは android/app/release.jks にキーストアを、~/.gradle/gradle.properties に署名パスワードを平文で書き込みますが、ファイル権限を制限していません。本PRのコミットではiOS配布証明書ファイルの権限を制限しており、Android側の機密ファイルにも同じ防御策を適用すると一貫性が向上します。

  • .github/workflows/build_android_canary.yml#L77-L108: printf ... > android/app/release.jks の直後と、python スクリプトで gradle.properties を書き込んだ直後に chmod 600 を追加してください。
  • .github/workflows/build_android_production.yml#L77-L108: canaryと同一の署名設定処理に同じ chmod 600 を追加してください。
🔒️ 修正案
       - name: Decode release keystore
         env:
           RELEASE_KEYSTORE_CONTENT: ${{ secrets.RELEASE_KEYSTORE }}
         run: |
           mkdir -p android/app
           printf '%s' "$RELEASE_KEYSTORE_CONTENT" | base64 --decode > android/app/release.jks
+          chmod 600 android/app/release.jks
           path = os.path.expanduser("~/.gradle/gradle.properties")
           with open(path, "a") as f:
               for key, value in entries.items():
                   f.write(f"{key}={escape(value)}\n")
+          os.chmod(path, 0o600)
          PY
🤖 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/build_android_canary.yml around lines 77 - 108, Restrict
permissions on Android signing secrets immediately after creation: in
.github/workflows/build_android_canary.yml lines 77-108, add chmod 600 after
writing android/app/release.jks and after the Python script writes
~/.gradle/gradle.properties; apply the same two changes in
.github/workflows/build_android_production.yml lines 77-108.

70-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

アクションのバージョンを最新化してください。 検索結果によると gradle/actions/setup-gradle の最新の主要バージョンはv6、r0adkll/upload-google-play の最新版はv1.1.4です。両ワークフローとも古いバージョンをピンしています。

  • .github/workflows/build_android_canary.yml#L70: gradle/actions/setup-gradle@v4 を最新のメジャーバージョンへ更新してください。
  • .github/workflows/build_android_canary.yml#L140: r0adkll/[email protected] を v1.1.4 へ更新してください。
  • .github/workflows/build_android_production.yml#L69-L70: canaryと同じ setup-gradle バージョンを使用しているため、同様に更新してください。
  • .github/workflows/build_android_production.yml#L138-L147: canaryと同じ upload-google-play バージョンを使用しているため、同様に更新してください。

私の知識は最新のライブラリバージョンについて古い可能性があります。上記の検索結果を踏まえて、実際にリポジトリで使用中のバージョンとの互換性、破壊的変更の有無を確認してください。

🤖 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/build_android_canary.yml at line 70, GitHub Actions
の依存バージョンを更新し、互換性と破壊的変更を確認してください。.github/workflows/build_android_canary.yml
の70行では gradle/actions/setup-gradle を最新のメジャーバージョンへ、140行では
r0adkll/upload-google-play を v1.1.4
へ更新し、.github/workflows/build_android_production.yml
の69-70行および138-147行にも同じバージョンを適用してください。既存のワークフロー設定と互換性を確認し、必要な調整がある場合のみ反映してください。
🤖 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/build_ios_canary.yml:
- Line 14:
両ワークフローのworkflow_dispatchにpublish_to_testflightのboolean入力を追加し、既定値をfalseに設定してください。.github/workflows/build_ios_canary.ymlのupload
stepはpush時または入力がtrueの場合のみ実行し、Production側にも同じ条件を適用してください。dry-run手順を文書化し、必要なsecrets、環境変数、Apple
service account権限、macOS
runner、Node.js、CocoaPodsの前提条件を記載してください。.github/workflows/build_ios_canary.ymlの14行目、153-175行目、および.github/workflows/build_ios_production.ymlの14行目を対象にしてください。
- Around line 28-31: Update the “Setup SSH for submodules” step to pin
webfactory/ssh-agent to the full commit SHA
a6f90b1f127823b31d4d4a8d96047790581349bd, and add a comment indicating that this
commit corresponds to v0.9.1.

---

Nitpick comments:
In @.github/workflows/build_android_canary.yml:
- Around line 77-108: Restrict permissions on Android signing secrets
immediately after creation: in .github/workflows/build_android_canary.yml lines
77-108, add chmod 600 after writing android/app/release.jks and after the Python
script writes ~/.gradle/gradle.properties; apply the same two changes in
.github/workflows/build_android_production.yml lines 77-108.
- Line 70: GitHub Actions
の依存バージョンを更新し、互換性と破壊的変更を確認してください。.github/workflows/build_android_canary.yml
の70行では gradle/actions/setup-gradle を最新のメジャーバージョンへ、140行では
r0adkll/upload-google-play を v1.1.4
へ更新し、.github/workflows/build_android_production.yml
の69-70行および138-147行にも同じバージョンを適用してください。既存のワークフロー設定と互換性を確認し、必要な調整がある場合のみ反映してください。
🪄 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: 5335125b-729b-4866-949f-615b56b6aca6

📥 Commits

Reviewing files that changed from the base of the PR and between 663d9b9 and b947f6b.

📒 Files selected for processing (4)
  • .github/workflows/build_android_canary.yml
  • .github/workflows/build_android_production.yml
  • .github/workflows/build_ios_canary.yml
  • .github/workflows/build_ios_production.yml

Comment thread .github/workflows/build_ios_canary.yml Resolved
Comment thread .github/workflows/build_ios_canary.yml Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
.github/workflows/build_android_production.yml (1)

1-23: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

本番 workflow の dry-run を安全にしてください。

workflow_dispatch.inputs.upload_to_play の既定値が true のため、手動実行で入力を変更しないと Google Play の internal track に公開します。既定値を false に変更し、必要な secrets、環境変数、サービスアカウント、dry-run 手順を Android workflow のドキュメントに追加してください。

🤖 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/build_android_production.yml around lines 1 - 23, 本番
Android workflow の手動実行が自動公開しないよう、workflow_dispatch.inputs.upload_to_play の
default を false に変更する。併せて、Android workflow のドキュメントに必要な
secrets、環境変数、サービスアカウント設定、dry-run 手順を追記する。

Source: Path instructions

.github/workflows/build_ios_canary.yml (4)

148-159: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

再実行を含む CURRENT_PROJECT_VERSION を設定してください。

github.run_number は再実行で変わらないため、両ワークフローの archive が同じ CFBundleVersion を生成します。Canary と Production の両方で CURRENT_PROJECT_VERSION="${{ github.run_number }}.${{ github.run_attempt }}" を使用してください。

🤖 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/build_ios_canary.yml around lines 148 - 159, Update the
xcodebuild archive command in .github/workflows/build_ios_canary.yml at lines
148-159 and .github/workflows/build_ios_production.yml at lines 148-159 to set
CURRENT_PROJECT_VERSION using both github.run_number and github.run_attempt,
ensuring reruns produce a distinct CFBundleVersion in both workflows.

1-21: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

任意の ref から署名ジョブを実行できないようにしてください。

Canary と Production の両方で、workflow_dispatch で選択した ref のコードが、同じ build ジョブ内で FONTS_SSH_KEY、App Store Connect API キー、配布証明書にアクセスできます。署名ジョブに信頼できる ref の条件や protected environment がありません。

署名および TestFlight upload を別ジョブに分離し、それぞれ canary または master の信頼できる ref に限定してください。Apple secrets には protected environment と required reviewers も設定してください。

🤖 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/build_ios_canary.yml around lines 1 - 21, Update
.github/workflows/build_ios_canary.yml lines 1-21 and
.github/workflows/build_ios_production.yml lines 1-21 so workflow_dispatch
cannot expose Apple secrets from arbitrary refs: split signing and TestFlight
upload out of the untrusted build job, restrict those jobs to the trusted canary
or master ref respectively, and attach protected environments with required
reviewers for FONTS_SSH_KEY, App Store Connect credentials, and distribution
certificates.

128-138: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

security import の -A を削除し、private key の ACL を限定してください。

PKCS #12 identity には private key が含まれます。-A は任意のアプリケーションにアクセスを許可します。-T で必要な signing tool だけを許可してください。両ワークフローに同じ制限を適用してください。

🤖 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/build_ios_canary.yml around lines 128 - 138, Remove the
broad -A option from the security import commands in
.github/workflows/build_ios_canary.yml lines 128-138 and
.github/workflows/build_ios_production.yml lines 128-138, and restrict the
imported private key ACL with -T entries for only the required signing tools.
Apply the same ACL configuration in both workflows while preserving the existing
set-key-partition-list behavior.

186-200: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

dSYM のアップロード前に署名資格情報を削除してください。

両ワークフローで、Remove signing credentials を Upload dSYM artifact より前に実行してください。Configure App Store Connect authentication では、base64 --decode の前に API_KEY_PATH を $GITHUB_ENV へ登録してください。decode が失敗しても、cleanup が同じ API key file を削除できるようにしてください。

🤖 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/build_ios_canary.yml around lines 186 - 200, In
.github/workflows/build_ios_canary.yml lines 186-200 and
.github/workflows/build_ios_production.yml lines 186-200, move the Remove
signing credentials step before Upload dSYM artifact while preserving its
always() cleanup behavior. In each workflow’s Configure App Store Connect
authentication step, export API_KEY_PATH to GITHUB_ENV before running base64
--decode so cleanup can remove the same file even when decoding fails.
🧹 Nitpick comments (3)
.github/workflows/build_android_production.yml (3)

59-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

node-version を文字列として指定してください。

Line 59 の node-version: 22 を node-version: "22" に変更してください。Action input の version を明示的な文字列にできます。

Based on learnings: .github/workflows の action input などの文字列は double quote を使用し、JavaScript/TypeScript の single quote 規約を YAML workflow に適用しません。

修正例
-          node-version: 22
+          node-version: "22"
🤖 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/build_android_production.yml at line 59, In the workflow’s
node-version setting, update the numeric value for node version 22 to an
explicitly double-quoted string, preserving the existing version.

Source: Learnings


35-36: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

外部 Action を full-length commit SHA に固定してください。

webfactory/ssh-agent の参照は正しいため変更不要です。gradle/actions/[email protected] を 9c971963bec38e04b3d30dcc455b5382be2fdbfb に、r0adkll/[email protected] を e738b9dd8f2476ea806d921b64aacd24f34515a5 に固定してください。後者は PLAY_SERVICE_ACCOUNT_JSON を受け取ります。

🤖 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/build_android_production.yml around lines 35 - 36, 外部
Action の参照を完全なコミット SHA に固定してください。gradle/actions/[email protected] を
9c971963bec38e04b3d30dcc455b5382be2fdbfb に、r0adkll/[email protected] を
e738b9dd8f2476ea806d921b64aacd24f34515a5 に更新し、webfactory/ssh-agent の参照と
upload-google-play の PLAY_SERVICE_ACCOUNT_JSON 入力は変更しないでください。

143-150: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

track を tracks に変更してください。

track は将来削除予定です。tracks: internal に変更してください。

🤖 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/build_android_production.yml around lines 143 - 150,
Update the upload-google-play action configuration in the release workflow by
replacing the deprecated track input with the tracks input, preserving its value
as internal.
🤖 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/build_android_production.yml:
- Around line 1-23: 本番 Android workflow
の手動実行が自動公開しないよう、workflow_dispatch.inputs.upload_to_play の default を false
に変更する。併せて、Android workflow のドキュメントに必要な secrets、環境変数、サービスアカウント設定、dry-run 手順を追記する。

In @.github/workflows/build_ios_canary.yml:
- Around line 148-159: Update the xcodebuild archive command in
.github/workflows/build_ios_canary.yml at lines 148-159 and
.github/workflows/build_ios_production.yml at lines 148-159 to set
CURRENT_PROJECT_VERSION using both github.run_number and github.run_attempt,
ensuring reruns produce a distinct CFBundleVersion in both workflows.
- Around line 1-21: Update .github/workflows/build_ios_canary.yml lines 1-21 and
.github/workflows/build_ios_production.yml lines 1-21 so workflow_dispatch
cannot expose Apple secrets from arbitrary refs: split signing and TestFlight
upload out of the untrusted build job, restrict those jobs to the trusted canary
or master ref respectively, and attach protected environments with required
reviewers for FONTS_SSH_KEY, App Store Connect credentials, and distribution
certificates.
- Around line 128-138: Remove the broad -A option from the security import
commands in .github/workflows/build_ios_canary.yml lines 128-138 and
.github/workflows/build_ios_production.yml lines 128-138, and restrict the
imported private key ACL with -T entries for only the required signing tools.
Apply the same ACL configuration in both workflows while preserving the existing
set-key-partition-list behavior.
- Around line 186-200: In .github/workflows/build_ios_canary.yml lines 186-200
and .github/workflows/build_ios_production.yml lines 186-200, move the Remove
signing credentials step before Upload dSYM artifact while preserving its
always() cleanup behavior. In each workflow’s Configure App Store Connect
authentication step, export API_KEY_PATH to GITHUB_ENV before running base64
--decode so cleanup can remove the same file even when decoding fails.

---

Nitpick comments:
In @.github/workflows/build_android_production.yml:
- Line 59: In the workflow’s node-version setting, update the numeric value for
node version 22 to an explicitly double-quoted string, preserving the existing
version.
- Around line 35-36: 外部 Action の参照を完全なコミット SHA
に固定してください。gradle/actions/[email protected] を
9c971963bec38e04b3d30dcc455b5382be2fdbfb に、r0adkll/[email protected] を
e738b9dd8f2476ea806d921b64aacd24f34515a5 に更新し、webfactory/ssh-agent の参照と
upload-google-play の PLAY_SERVICE_ACCOUNT_JSON 入力は変更しないでください。
- Around line 143-150: Update the upload-google-play action configuration in the
release workflow by replacing the deprecated track input with the tracks input,
preserving its value as internal.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 63c56ddb-622f-429b-ab64-65dd77d7ec35

📥 Commits

Reviewing files that changed from the base of the PR and between b947f6b and c77d600.

📒 Files selected for processing (5)
  • .github/workflows/build_android_canary.yml
  • .github/workflows/build_android_production.yml
  • .github/workflows/build_ios_canary.yml
  • .github/workflows/build_ios_production.yml
  • docs/ios-build-workflows.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build_android_canary.yml

@TinyKitten

Copy link
Copy Markdown
Member Author

@coderabbitai 任意refからの workflow_dispatch で署名用secretsへアクセスできる点については、現状このリポジトリへ書き込むのがほぼ単一メンテナであることと、任意refで署名archiveを検証できる利便性を考慮し、今回はリスクを受容して保留します。書き込み主体が増えた場合は、署名ジョブの分離とrequired reviewer付きGitHub Environmentへのsecrets移行を実施します。

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@TinyKitten 承知しました。この PR では、任意 ref の workflow_dispatch による signing secrets へのアクセスを、現行の書き込み権限モデルと archive 検証の利便性を踏まえて受容する判断として扱います。

書き込み主体が増える場合は、署名ジョブを分離し、required reviewer を設定した GitHub Environment へ secrets を移行する方針を記録しました。

🐇


✏️ Learnings added
Learnt from: TinyKitten
URL: https://github.com/TrainLCD/MobileApp/pull/6513

Timestamp: 2026-08-03T10:04:31.800Z
Learning: PR `#6513` の GitHub Actions モバイルビルドでは、任意 ref の `workflow_dispatch` が signing secrets にアクセスできるリスクを受容している。現時点ではリポジトリへの書き込み主体がほぼ単一メンテナであり、任意 ref で署名済み archive を検証する利便性を優先する。書き込み主体が増えた場合は、署名ジョブを分離し、required reviewer を設定した GitHub Environment に signing secrets を移行する。

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@TinyKitten
TinyKitten merged commit 1f4baed into dev Aug 3, 2026
3 checks passed
@TinyKitten
TinyKitten deleted the feature/ios-build-workflow branch August 3, 2026 10:05
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.

1 participant