Structure
ActionContext
Shared context passed to every action during execution.
struct ActionContextOverview
Provides access to the shell execution environment, logger, resolved configuration, App Store Connect client, and (for Android) Google Play client.
Usage
struct MyAction: Action {
func run(with options: Options, context: ActionContext) async throws -> Result {
let output = try await GitCLI(context: context.shell).statusPorcelain().run()
context.logger.info("Git status: \(output.stdout)")
return Result()
}
}Topics
Initializers
Instance Properties
let appStoreConnect: AppStoreConnectClientApp Store Connect API client (iOS, macOS only).
let config: ResolvedConfigMerged configuration from Shipfile + env + CLI.
var configIsCI: Boollet googlePlay: GooglePlayClient?Google Play API client (Android).
nilwhen Google Play credentials are not configured.let jsonOutput: BoolWhen
true, the command’s result is being emitted as machine-readable JSON on stdout.let logger: LoggerStructured logger scoped to the current operation.
let platform: PlatformTarget platform for this run.
let shell: ShellContextSwiftyShell context for executing shell commands.
let verbose: BoolWhen
true, raw stdout/stderr from shell commands is emitted at debug log level.
Instance Methods
func ensureProjectGenerated() async throwsActions that require an Xcode container (
.xcodeproj/.xcworkspace) call this method to ensure the project exists. If project generation is configured and the output project is missing, this runs the generation command automatically.func gradle() -> GradleCreates a Gradle command family with ShipIt’s resolved project settings applied.
func linkKMPFramework(buildConfiguration: String, target: String, module: String?) async throwsLinks the KMP shared framework when targeting iOS with
BuildSystem.kmp.func logShellOutput(ShellOutput, label: String)Logs
stdoutandstderrfrom a shell command at.debuglevel when verbose is enabled.func streamingGradle() -> GradleReturns a Gradle builder configured to stream output live for long-running builds.
func streamingXcodeBuild() -> XcodeBuildReturns an
XcodeBuildbuilder configured to stream output live for long-running builds.func withConfig(ResolvedConfig) -> ActionContextReturns a copy of this context with the given config, preserving all other fields.
func withGradleProjectDir(String) -> ActionContextReturns a copy of this context with the Gradle project directory overridden.
Type Methods
static func mock(executor: MockExecutor, versioningSource: String, platform: Platform, jsonOutput: Bool, config: ResolvedConfig?) -> ActionContextCreates a mock
ActionContextfor use in tests.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype