$npx -y skills add rorkai/app-store-connect-cli-skills --skill asc-workflowDefine, validate, run, resume, and audit repo-local multi-step automations with current asc workflow and .asc/workflow.json, including step outputs and safe release/TestFlight workflows.
| 1 | # asc workflow |
| 2 | |
| 3 | Use this skill when you need lane-style automation inside the CLI using: |
| 4 | |
| 5 | - `asc workflow validate` |
| 6 | - `asc workflow list` |
| 7 | - `asc workflow run` |
| 8 | |
| 9 | Workflows are repo-local automation files. They run trusted shell commands, stream step output to stderr, and keep stdout as machine-readable JSON. |
| 10 | |
| 11 | ## Command discovery |
| 12 | |
| 13 | Always verify flags with: |
| 14 | |
| 15 | ```bash |
| 16 | asc workflow --help |
| 17 | asc workflow validate --help |
| 18 | asc workflow list --help |
| 19 | asc workflow run --help |
| 20 | ``` |
| 21 | |
| 22 | ## End-to-end flow |
| 23 | |
| 24 | 1. Author `.asc/workflow.json`. |
| 25 | 2. Validate structure and references: |
| 26 | |
| 27 | ```bash |
| 28 | asc workflow validate |
| 29 | ``` |
| 30 | |
| 31 | 3. Discover public workflows: |
| 32 | |
| 33 | ```bash |
| 34 | asc workflow list |
| 35 | asc workflow list --all |
| 36 | ``` |
| 37 | |
| 38 | 4. Preview execution: |
| 39 | |
| 40 | ```bash |
| 41 | asc workflow run --dry-run beta BUILD_ID:123456789 GROUP_ID:abcdef |
| 42 | ``` |
| 43 | |
| 44 | 5. Execute: |
| 45 | |
| 46 | ```bash |
| 47 | asc workflow run beta BUILD_ID:123456789 GROUP_ID:abcdef |
| 48 | ``` |
| 49 | |
| 50 | 6. If a recoverable run fails, resume with the run ID from the JSON result: |
| 51 | |
| 52 | ```bash |
| 53 | asc workflow run release --resume "release-20260312T120000Z-deadbeef" |
| 54 | ``` |
| 55 | |
| 56 | Do not pass extra `KEY:VALUE` params with `--resume`; the saved workflow file, params, and persisted outputs are reused. |
| 57 | |
| 58 | ## File location and format |
| 59 | |
| 60 | - Default path: `.asc/workflow.json` |
| 61 | - Override path: `asc workflow run --file ./path/to/workflow.json <name>` |
| 62 | - JSONC comments are supported. |
| 63 | - Top-level hooks: `before_all`, `after_all`, `error` |
| 64 | - Workflow keys: `description`, `private`, `env`, `steps` |
| 65 | - Step forms: |
| 66 | - string shorthand: `"echo hello"` |
| 67 | - `run` shell command |
| 68 | - `workflow` sub-workflow call |
| 69 | - `name` label |
| 70 | - `if` conditional var name |
| 71 | - `with` env overrides for workflow-call steps |
| 72 | - `outputs` map for JSON stdout extraction from named run steps |
| 73 | |
| 74 | ## Outputs |
| 75 | |
| 76 | Run steps can declare outputs. The command must emit JSON on stdout, so pass `--output json` for `asc` commands that produce outputs. |
| 77 | |
| 78 | Output references use: |
| 79 | |
| 80 | ```text |
| 81 | ${steps.step_name.OUTPUT_NAME} |
| 82 | ``` |
| 83 | |
| 84 | Rules: |
| 85 | |
| 86 | - A step that declares `outputs` must have a reference-safe `name`. |
| 87 | - Outputs are allowed on `run` steps, not workflow-call steps. |
| 88 | - Output-producing names must be unique across workflows that can execute together in the same run graph. |
| 89 | - Persisted outputs are stored in workflow run state, so do not map secrets into outputs. |
| 90 | |
| 91 | ## Runtime params |
| 92 | |
| 93 | `asc workflow run <name> [KEY:VALUE ...]` supports both separators: |
| 94 | |
| 95 | ```bash |
| 96 | asc workflow run beta VERSION:2.1.0 |
| 97 | asc workflow run beta VERSION=2.1.0 |
| 98 | ``` |
| 99 | |
| 100 | Repeated keys are last-write-wins. In shell commands, reference params through shell expansion like `$VERSION`. |
| 101 | |
| 102 | ## Env precedence |
| 103 | |
| 104 | Main workflow run: |
| 105 | |
| 106 | ```text |
| 107 | definition.env < workflow.env < CLI params |
| 108 | ``` |
| 109 | |
| 110 | Sub-workflow call with `with`: |
| 111 | |
| 112 | ```text |
| 113 | sub-workflow env < caller env and params < step with |
| 114 | ``` |
| 115 | |
| 116 | ## Conditionals |
| 117 | |
| 118 | Add `"if": "VAR_NAME"` to a step. Truthy values are `1`, `true`, `yes`, `y`, and `on`, case-insensitive. Lookup checks merged workflow env/params first, then process environment. |
| 119 | |
| 120 | ## Example workflow |
| 121 | |
| 122 | ```json |
| 123 | { |
| 124 | "env": { |
| 125 | "APP_ID": "123456789", |
| 126 | "VERSION": "1.0.0", |
| 127 | "GROUP_ID": "" |
| 128 | }, |
| 129 | "before_all": "asc auth status", |
| 130 | "after_all": "echo workflow_done", |
| 131 | "error": "echo workflow_failed", |
| 132 | "workflows": { |
| 133 | "beta": { |
| 134 | "description": "Resolve the latest build and distribute it to TestFlight", |
| 135 | "steps": [ |
| 136 | { |
| 137 | "name": "resolve_build", |
| 138 | "run": "asc builds info --app $APP_ID --latest --platform IOS --output json", |
| 139 | "outputs": { |
| 140 | "BUILD_ID": "$.data.id" |
| 141 | } |
| 142 | }, |
| 143 | { |
| 144 | "name": "list_groups", |
| 145 | "run": "asc testflight groups list --app $APP_ID --limit 20 --output json" |
| 146 | }, |
| 147 | { |
| 148 | "name": "add_build_to_group", |
| 149 | "if": "GROUP_ID", |
| 150 | "run": "asc builds add-groups --build-id ${steps.resolve_build.BUILD_ID} --group $GROUP_ID" |
| 151 | } |
| 152 | ] |
| 153 | }, |
| 154 | "release": { |
| 155 | "description": "Validate, stage, and submit an App Store version", |
| 156 | "steps": [ |
| 157 | { |
| 158 | "name": "validate", |
| 159 | "run": "asc validate --app $APP_ID --version $VERSION --platform IOS --output json" |
| 160 | }, |
| 161 | { |
| 162 | "name": "stage", |
| 163 | "run": "asc release stage --app $APP_ID --version $VERSION --build $BUILD_ID --metadata-dir ./metadata/version/$VERSION --confirm --output json" |
| 164 | }, |
| 165 | { |
| 166 | "name": "submit", |
| 167 | "if": "SUBMIT_FOR_REVIEW", |
| 168 | "run": "asc review submit --app $APP_ID --version $VERSION --build $BUILD_ID --confirm --output json" |
| 169 | } |
| 170 | ] |
| 171 | }, |
| 172 | "publish-appstore": { |
| 173 | "description": "High-level upload plus App Store review submission", |
| 174 | "steps": [ |
| 175 | { |
| 176 | "name": "publish", |
| 177 | "run": "asc publish appstore --app $APP_ID --ipa ./build/MyApp.ipa --version $VERSION --wai |