fix(ci): preserve iOS Fastlane root after cd (#128854)

This commit is contained in:
Vincent Koc
2026-08-24 14:06:37 -07:00
committed by GitHub
parent d48166515e
commit c40e787309
2 changed files with 25 additions and 3 deletions
+4 -1
View File
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
# BASH_SOURCE may be relative, so resolve it before callers change directories.
_OPENCLAW_IOS_FASTLANE_REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
run_ios_fastlane() {
local gemfile=""
gemfile="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/apps/ios/Gemfile"
gemfile="${_OPENCLAW_IOS_FASTLANE_REPO_ROOT}/apps/ios/Gemfile"
local setup_hint=""
setup_hint="Install Ruby 3.4.10, then run: cd apps/ios && gem install bundler -v 2.6.9 && bundle _2.6.9_ install"
+21 -2
View File
@@ -156,7 +156,11 @@ describe("iOS release shell wrapper arguments", () => {
expect(script).toContain('export GIT_COMMIT="${RELEASE_GIT_COMMIT}"');
});
function runSharedFastlane(options: { fastlaneExit: number; bundleGemfile?: string }) {
function runSharedFastlane(options: {
fastlaneExit: number;
bundleGemfile?: string;
changeDirectoryAfterSource?: boolean;
}) {
const binDir = tempDirs.make("openclaw-fastlane-test-");
const bundle = path.join(binDir, "bundle");
const fastlane = path.join(binDir, "fastlane");
@@ -175,7 +179,12 @@ describe("iOS release shell wrapper arguments", () => {
chmodSync(fastlane, 0o755);
return spawnSync(
BASH_BIN,
["-c", "source scripts/lib/ios-fastlane.sh; run_ios_fastlane ios release_plan"],
[
"-c",
options.changeDirectoryAfterSource
? "source scripts/lib/ios-fastlane.sh; cd apps/ios; run_ios_fastlane ios release_plan"
: "source scripts/lib/ios-fastlane.sh; run_ios_fastlane ios release_plan",
],
{
cwd: process.cwd(),
env: {
@@ -202,4 +211,14 @@ describe("iOS release shell wrapper arguments", () => {
expect(result.status).toBe(0);
});
it("keeps the repository Gemfile after the caller changes directories", () => {
const result = runSharedFastlane({
bundleGemfile: "/tmp/hostile/Gemfile",
changeDirectoryAfterSource: true,
fastlaneExit: 0,
});
expect(result.status).toBe(0);
});
});