@invarn/cibuild 2.9.6 → 2.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-35SI42CD.mjs +1 -0
- package/dist/chunk-IC45KVLJ.mjs +1 -0
- package/dist/chunk-XDY4V23V.mjs +1 -0
- package/dist/cli.cjs +14 -14
- package/dist/commands.mjs +1 -0
- package/dist/lib.mjs +3934 -0
- package/package.json +6 -10
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -399
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts +0 -38
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.js +0 -222
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts +0 -41
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.js +0 -324
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts +0 -2
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts.map +0 -1
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.js +0 -382
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts +0 -29
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts.map +0 -1
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.js +0 -160
- package/dist/src/commands/android-gms-guard.test.d.ts +0 -9
- package/dist/src/commands/android-gms-guard.test.d.ts.map +0 -1
- package/dist/src/commands/android-gms-guard.test.js +0 -78
- package/dist/src/commands/android-java-version.test.d.ts +0 -12
- package/dist/src/commands/android-java-version.test.d.ts.map +0 -1
- package/dist/src/commands/android-java-version.test.js +0 -209
- package/dist/src/commands/android-scanner-java.test.d.ts +0 -2
- package/dist/src/commands/android-scanner-java.test.d.ts.map +0 -1
- package/dist/src/commands/android-scanner-java.test.js +0 -130
- package/dist/src/commands/android-scanner.d.ts +0 -250
- package/dist/src/commands/android-scanner.d.ts.map +0 -1
- package/dist/src/commands/android-scanner.js +0 -1639
- package/dist/src/commands/build.d.ts +0 -215
- package/dist/src/commands/build.d.ts.map +0 -1
- package/dist/src/commands/build.js +0 -1433
- package/dist/src/commands/build.test.d.ts +0 -13
- package/dist/src/commands/build.test.d.ts.map +0 -1
- package/dist/src/commands/build.test.js +0 -121
- package/dist/src/commands/detect-platform.d.ts +0 -13
- package/dist/src/commands/detect-platform.d.ts.map +0 -1
- package/dist/src/commands/detect-platform.js +0 -51
- package/dist/src/commands/detect-project.d.ts +0 -7
- package/dist/src/commands/detect-project.d.ts.map +0 -1
- package/dist/src/commands/detect-project.js +0 -12
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts +0 -26
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts.map +0 -1
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.js +0 -196
- package/dist/src/commands/edit.d.ts +0 -12
- package/dist/src/commands/edit.d.ts.map +0 -1
- package/dist/src/commands/edit.js +0 -652
- package/dist/src/commands/edit.test.d.ts +0 -6
- package/dist/src/commands/edit.test.d.ts.map +0 -1
- package/dist/src/commands/edit.test.js +0 -45
- package/dist/src/commands/fidelity-trim.d.ts +0 -13
- package/dist/src/commands/fidelity-trim.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.js +0 -21
- package/dist/src/commands/fidelity-trim.test.d.ts +0 -8
- package/dist/src/commands/fidelity-trim.test.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.test.js +0 -79
- package/dist/src/commands/file-secret-collector.d.ts +0 -50
- package/dist/src/commands/file-secret-collector.d.ts.map +0 -1
- package/dist/src/commands/file-secret-collector.js +0 -217
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts +0 -38
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts.map +0 -1
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.js +0 -300
- package/dist/src/commands/github-workflow.d.ts +0 -5
- package/dist/src/commands/github-workflow.d.ts.map +0 -1
- package/dist/src/commands/github-workflow.js +0 -45
- package/dist/src/commands/index.d.ts +0 -33
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -33
- package/dist/src/commands/init.d.ts +0 -20
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js +0 -264
- package/dist/src/commands/ios-scanner.d.ts +0 -104
- package/dist/src/commands/ios-scanner.d.ts.map +0 -1
- package/dist/src/commands/ios-scanner.js +0 -492
- package/dist/src/commands/ios-scheme-ranking.test.d.ts +0 -2
- package/dist/src/commands/ios-scheme-ranking.test.d.ts.map +0 -1
- package/dist/src/commands/ios-scheme-ranking.test.js +0 -264
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts +0 -30
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/local-properties-reaches-every-workflow.test.js +0 -146
- package/dist/src/commands/reset.d.ts +0 -7
- package/dist/src/commands/reset.d.ts.map +0 -1
- package/dist/src/commands/reset.js +0 -81
- package/dist/src/commands/run.d.ts +0 -22
- package/dist/src/commands/run.d.ts.map +0 -1
- package/dist/src/commands/run.js +0 -141
- package/dist/src/commands/secrets-sync-workflow.d.ts +0 -15
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +0 -1
- package/dist/src/commands/secrets-sync-workflow.js +0 -255
- package/dist/src/commands/secrets-upload.d.ts +0 -21
- package/dist/src/commands/secrets-upload.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.js +0 -177
- package/dist/src/commands/secrets-upload.test.d.ts +0 -5
- package/dist/src/commands/secrets-upload.test.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.test.js +0 -60
- package/dist/src/commands/validate.d.ts +0 -10
- package/dist/src/commands/validate.d.ts.map +0 -1
- package/dist/src/commands/validate.js +0 -46
- package/dist/src/config.d.ts +0 -3
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -47
- package/dist/src/envman/cli.d.ts +0 -21
- package/dist/src/envman/cli.d.ts.map +0 -1
- package/dist/src/envman/cli.js +0 -240
- package/dist/src/envman/envman.d.ts +0 -83
- package/dist/src/envman/envman.d.ts.map +0 -1
- package/dist/src/envman/envman.js +0 -361
- package/dist/src/envman/envman.test.d.ts +0 -5
- package/dist/src/envman/envman.test.d.ts.map +0 -1
- package/dist/src/envman/envman.test.js +0 -236
- package/dist/src/envman/envstore-round-trip.test.d.ts +0 -27
- package/dist/src/envman/envstore-round-trip.test.d.ts.map +0 -1
- package/dist/src/envman/envstore-round-trip.test.js +0 -130
- package/dist/src/envman/index.d.ts +0 -23
- package/dist/src/envman/index.d.ts.map +0 -1
- package/dist/src/envman/index.js +0 -23
- package/dist/src/envman/shim.d.ts +0 -16
- package/dist/src/envman/shim.d.ts.map +0 -1
- package/dist/src/envman/shim.js +0 -66
- package/dist/src/envman/types.d.ts +0 -55
- package/dist/src/envman/types.d.ts.map +0 -1
- package/dist/src/envman/types.js +0 -12
- package/dist/src/lib.d.ts +0 -33
- package/dist/src/lib.d.ts.map +0 -1
- package/dist/src/lib.js +0 -37
- package/dist/src/pipeline.d.ts +0 -3
- package/dist/src/pipeline.d.ts.map +0 -1
- package/dist/src/pipeline.js +0 -57
- package/dist/src/runner-node-step.test.d.ts +0 -12
- package/dist/src/runner-node-step.test.d.ts.map +0 -1
- package/dist/src/runner-node-step.test.js +0 -61
- package/dist/src/runner.d.ts +0 -31
- package/dist/src/runner.d.ts.map +0 -1
- package/dist/src/runner.js +0 -240
- package/dist/src/shared/detect-project.d.ts +0 -57
- package/dist/src/shared/detect-project.d.ts.map +0 -1
- package/dist/src/shared/detect-project.js +0 -219
- package/dist/src/shared/detect-project.test.d.ts +0 -2
- package/dist/src/shared/detect-project.test.d.ts.map +0 -1
- package/dist/src/shared/detect-project.test.js +0 -161
- package/dist/src/shared/git.d.ts +0 -25
- package/dist/src/shared/git.d.ts.map +0 -1
- package/dist/src/shared/git.js +0 -53
- package/dist/src/shared/git.test.d.ts +0 -9
- package/dist/src/shared/git.test.d.ts.map +0 -1
- package/dist/src/shared/git.test.js +0 -66
- package/dist/src/shared/gitignore.d.ts +0 -6
- package/dist/src/shared/gitignore.d.ts.map +0 -1
- package/dist/src/shared/gitignore.js +0 -26
- package/dist/src/shared/gradle-settings.d.ts +0 -49
- package/dist/src/shared/gradle-settings.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.js +0 -138
- package/dist/src/shared/gradle-settings.test.d.ts +0 -2
- package/dist/src/shared/gradle-settings.test.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.test.js +0 -65
- package/dist/src/shared/prompts.d.ts +0 -30
- package/dist/src/shared/prompts.d.ts.map +0 -1
- package/dist/src/shared/prompts.js +0 -121
- package/dist/src/shared/xcode-container.test.d.ts +0 -2
- package/dist/src/shared/xcode-container.test.d.ts.map +0 -1
- package/dist/src/shared/xcode-container.test.js +0 -123
- package/dist/src/step-marker.d.ts +0 -12
- package/dist/src/step-marker.d.ts.map +0 -1
- package/dist/src/step-marker.js +0 -29
- package/dist/src/step-marker.test.d.ts +0 -11
- package/dist/src/step-marker.test.d.ts.map +0 -1
- package/dist/src/step-marker.test.js +0 -45
- package/dist/src/types.d.ts +0 -58
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts +0 -28
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts.map +0 -1
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.js +0 -223
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts +0 -20
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.js +0 -201
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts +0 -37
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.js +0 -255
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts +0 -32
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts.map +0 -1
- package/dist/src/yaml/a-missing-credential-is-loud.test.js +0 -301
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts +0 -18
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts.map +0 -1
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.js +0 -66
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts +0 -34
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.js +0 -218
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts +0 -27
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.js +0 -126
- package/dist/src/yaml/bitrise-compat.d.ts +0 -65
- package/dist/src/yaml/bitrise-compat.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.js +0 -206
- package/dist/src/yaml/bitrise-compat.test.d.ts +0 -5
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.test.js +0 -347
- package/dist/src/yaml/cache-key-missing-file.test.d.ts +0 -12
- package/dist/src/yaml/cache-key-missing-file.test.d.ts.map +0 -1
- package/dist/src/yaml/cache-key-missing-file.test.js +0 -116
- package/dist/src/yaml/converter.d.ts +0 -103
- package/dist/src/yaml/converter.d.ts.map +0 -1
- package/dist/src/yaml/converter.js +0 -420
- package/dist/src/yaml/converter.test.d.ts +0 -5
- package/dist/src/yaml/converter.test.d.ts.map +0 -1
- package/dist/src/yaml/converter.test.js +0 -548
- package/dist/src/yaml/e2e.test.d.ts +0 -6
- package/dist/src/yaml/e2e.test.d.ts.map +0 -1
- package/dist/src/yaml/e2e.test.js +0 -446
- package/dist/src/yaml/env-resolver.d.ts +0 -218
- package/dist/src/yaml/env-resolver.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.js +0 -591
- package/dist/src/yaml/env-resolver.test.d.ts +0 -5
- package/dist/src/yaml/env-resolver.test.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.test.js +0 -502
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts +0 -16
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts.map +0 -1
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.js +0 -126
- package/dist/src/yaml/fidelity-input-digest.d.ts +0 -37
- package/dist/src/yaml/fidelity-input-digest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.js +0 -208
- package/dist/src/yaml/fidelity-input-digest.test.d.ts +0 -2
- package/dist/src/yaml/fidelity-input-digest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.test.js +0 -167
- package/dist/src/yaml/fidelity-manifest.d.ts +0 -126
- package/dist/src/yaml/fidelity-manifest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.js +0 -134
- package/dist/src/yaml/fidelity-manifest.test.d.ts +0 -12
- package/dist/src/yaml/fidelity-manifest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.test.js +0 -251
- package/dist/src/yaml/interactive-prompts.d.ts +0 -71
- package/dist/src/yaml/interactive-prompts.d.ts.map +0 -1
- package/dist/src/yaml/interactive-prompts.js +0 -260
- package/dist/src/yaml/meta-helpers.d.ts +0 -28
- package/dist/src/yaml/meta-helpers.d.ts.map +0 -1
- package/dist/src/yaml/meta-helpers.js +0 -46
- package/dist/src/yaml/missing-env-handler.d.ts +0 -45
- package/dist/src/yaml/missing-env-handler.d.ts.map +0 -1
- package/dist/src/yaml/missing-env-handler.js +0 -64
- package/dist/src/yaml/parser.d.ts +0 -33
- package/dist/src/yaml/parser.d.ts.map +0 -1
- package/dist/src/yaml/parser.js +0 -148
- package/dist/src/yaml/parser.test.d.ts +0 -5
- package/dist/src/yaml/parser.test.d.ts.map +0 -1
- package/dist/src/yaml/parser.test.js +0 -83
- package/dist/src/yaml/pipeline-with-secrets.d.ts +0 -25
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +0 -1
- package/dist/src/yaml/pipeline-with-secrets.js +0 -76
- package/dist/src/yaml/platform-detector.d.ts +0 -83
- package/dist/src/yaml/platform-detector.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.js +0 -189
- package/dist/src/yaml/platform-detector.test.d.ts +0 -5
- package/dist/src/yaml/platform-detector.test.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.test.js +0 -525
- package/dist/src/yaml/preflight-validation.d.ts +0 -29
- package/dist/src/yaml/preflight-validation.d.ts.map +0 -1
- package/dist/src/yaml/preflight-validation.js +0 -21
- package/dist/src/yaml/secrets-manager.d.ts +0 -87
- package/dist/src/yaml/secrets-manager.d.ts.map +0 -1
- package/dist/src/yaml/secrets-manager.js +0 -230
- package/dist/src/yaml/shell-assignments.d.ts +0 -40
- package/dist/src/yaml/shell-assignments.d.ts.map +0 -1
- package/dist/src/yaml/shell-assignments.js +0 -77
- package/dist/src/yaml/step-validator-check-failure.test.d.ts +0 -24
- package/dist/src/yaml/step-validator-check-failure.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-check-failure.test.js +0 -130
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts +0 -23
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-self-assigned.test.js +0 -191
- package/dist/src/yaml/step-validator.d.ts +0 -67
- package/dist/src/yaml/step-validator.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.js +0 -466
- package/dist/src/yaml/step-validator.test.d.ts +0 -18
- package/dist/src/yaml/step-validator.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.test.js +0 -140
- package/dist/src/yaml/steps/a-missing-pinned-jdk-yields-for-every-gradle-run.test.d.ts +0 -2
- package/dist/src/yaml/steps/a-missing-pinned-jdk-yields-for-every-gradle-run.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/a-missing-pinned-jdk-yields-for-every-gradle-run.test.js +0 -96
- package/dist/src/yaml/steps/android-sign.d.ts +0 -35
- package/dist/src/yaml/steps/android-sign.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-sign.js +0 -147
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts +0 -2
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-variant-resolution.test.js +0 -260
- package/dist/src/yaml/steps/android-version.d.ts +0 -26
- package/dist/src/yaml/steps/android-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.js +0 -128
- package/dist/src/yaml/steps/android-version.test.d.ts +0 -5
- package/dist/src/yaml/steps/android-version.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.test.js +0 -196
- package/dist/src/yaml/steps/android.d.ts +0 -156
- package/dist/src/yaml/steps/android.d.ts.map +0 -1
- package/dist/src/yaml/steps/android.js +0 -1100
- package/dist/src/yaml/steps/app-store-deploy.d.ts +0 -48
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/app-store-deploy.js +0 -167
- package/dist/src/yaml/steps/base.d.ts +0 -263
- package/dist/src/yaml/steps/base.d.ts.map +0 -1
- package/dist/src/yaml/steps/base.js +0 -380
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +0 -26
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.js +0 -200
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +0 -280
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +0 -22
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.js +0 -144
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +0 -331
- package/dist/src/yaml/steps/bitrise-slack.d.ts +0 -49
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.js +0 -280
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.test.js +0 -484
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +0 -27
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.js +0 -134
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.test.js +0 -205
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-daemon.test.js +0 -212
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts +0 -42
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.js +0 -209
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-push-daemon.test.js +0 -171
- package/dist/src/yaml/steps/cache.d.ts +0 -59
- package/dist/src/yaml/steps/cache.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache.js +0 -1027
- package/dist/src/yaml/steps/capture-injection.d.ts +0 -30
- package/dist/src/yaml/steps/capture-injection.d.ts.map +0 -1
- package/dist/src/yaml/steps/capture-injection.js +0 -88
- package/dist/src/yaml/steps/capture-injection.test.d.ts +0 -2
- package/dist/src/yaml/steps/capture-injection.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/capture-injection.test.js +0 -163
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +0 -42
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.js +0 -140
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +0 -11
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +0 -176
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts +0 -22
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.js +0 -97
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.js +0 -282
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.js +0 -132
- package/dist/src/yaml/steps/envstore-loader.test.d.ts +0 -15
- package/dist/src/yaml/steps/envstore-loader.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/envstore-loader.test.js +0 -143
- package/dist/src/yaml/steps/fastlane.d.ts +0 -27
- package/dist/src/yaml/steps/fastlane.d.ts.map +0 -1
- package/dist/src/yaml/steps/fastlane.js +0 -79
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts +0 -53
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.js +0 -72
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts +0 -11
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.js +0 -50
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts +0 -87
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.js +0 -111
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts +0 -22
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.js +0 -118
- package/dist/src/yaml/steps/file.d.ts +0 -52
- package/dist/src/yaml/steps/file.d.ts.map +0 -1
- package/dist/src/yaml/steps/file.js +0 -108
- package/dist/src/yaml/steps/flutter.d.ts +0 -63
- package/dist/src/yaml/steps/flutter.d.ts.map +0 -1
- package/dist/src/yaml/steps/flutter.js +0 -215
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts +0 -16
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.js +0 -127
- package/dist/src/yaml/steps/git-clone.d.ts +0 -32
- package/dist/src/yaml/steps/git-clone.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone.js +0 -171
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts +0 -10
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.js +0 -162
- package/dist/src/yaml/steps/git-fetch-retry.d.ts +0 -62
- package/dist/src/yaml/steps/git-fetch-retry.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.js +0 -155
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts +0 -5
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.test.js +0 -86
- package/dist/src/yaml/steps/google-play-deploy.d.ts +0 -37
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.js +0 -193
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +0 -5
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.test.js +0 -310
- package/dist/src/yaml/steps/gradle-memory.d.ts +0 -91
- package/dist/src/yaml/steps/gradle-memory.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.js +0 -495
- package/dist/src/yaml/steps/gradle-memory.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-memory.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.test.js +0 -344
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts +0 -28
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.js +0 -107
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.js +0 -183
- package/dist/src/yaml/steps/index.d.ts +0 -10
- package/dist/src/yaml/steps/index.d.ts.map +0 -1
- package/dist/src/yaml/steps/index.js +0 -1461
- package/dist/src/yaml/steps/ios-deps.d.ts +0 -78
- package/dist/src/yaml/steps/ios-deps.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.js +0 -279
- package/dist/src/yaml/steps/ios-deps.test.d.ts +0 -5
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.test.js +0 -90
- package/dist/src/yaml/steps/ios-signing.d.ts +0 -31
- package/dist/src/yaml/steps/ios-signing.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-signing.js +0 -144
- package/dist/src/yaml/steps/ios-version.d.ts +0 -47
- package/dist/src/yaml/steps/ios-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-version.js +0 -151
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts +0 -10
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/java-home-version-spec.test.js +0 -58
- package/dist/src/yaml/steps/kotlin-metadata-compiles-on-a-daemon.test.d.ts +0 -2
- package/dist/src/yaml/steps/kotlin-metadata-compiles-on-a-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/kotlin-metadata-compiles-on-a-daemon.test.js +0 -139
- package/dist/src/yaml/steps/linting.d.ts +0 -47
- package/dist/src/yaml/steps/linting.d.ts.map +0 -1
- package/dist/src/yaml/steps/linting.js +0 -148
- package/dist/src/yaml/steps/phase2.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase2.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase2.test.js +0 -197
- package/dist/src/yaml/steps/phase3.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase3.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase3.test.js +0 -144
- package/dist/src/yaml/steps/phase4.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase4.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase4.test.js +0 -166
- package/dist/src/yaml/steps/phase5.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase5.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase5.test.js +0 -263
- package/dist/src/yaml/steps/registry.d.ts +0 -88
- package/dist/src/yaml/steps/registry.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.js +0 -125
- package/dist/src/yaml/steps/registry.test.d.ts +0 -5
- package/dist/src/yaml/steps/registry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.test.js +0 -235
- package/dist/src/yaml/steps/release.d.ts +0 -50
- package/dist/src/yaml/steps/release.d.ts.map +0 -1
- package/dist/src/yaml/steps/release.js +0 -154
- package/dist/src/yaml/steps/render-post-processor.d.ts +0 -100
- package/dist/src/yaml/steps/render-post-processor.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.js +0 -270
- package/dist/src/yaml/steps/render-post-processor.test.d.ts +0 -13
- package/dist/src/yaml/steps/render-post-processor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.test.js +0 -220
- package/dist/src/yaml/steps/script.d.ts +0 -23
- package/dist/src/yaml/steps/script.d.ts.map +0 -1
- package/dist/src/yaml/steps/script.js +0 -63
- package/dist/src/yaml/steps/spec-validation.test.d.ts +0 -6
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/spec-validation.test.js +0 -130
- package/dist/src/yaml/steps/steps.test.d.ts +0 -6
- package/dist/src/yaml/steps/steps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/steps.test.js +0 -881
- package/dist/src/yaml/steps/structural-facts.d.ts +0 -992
- package/dist/src/yaml/steps/structural-facts.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.js +0 -3276
- package/dist/src/yaml/steps/structural-facts.test.d.ts +0 -12
- package/dist/src/yaml/steps/structural-facts.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.test.js +0 -3039
- package/dist/src/yaml/steps/test-config.d.ts +0 -5
- package/dist/src/yaml/steps/test-config.d.ts.map +0 -1
- package/dist/src/yaml/steps/test-config.js +0 -25
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts +0 -28
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align-corpus.test.js +0 -383
- package/dist/src/yaml/steps/trim-align.d.ts +0 -87
- package/dist/src/yaml/steps/trim-align.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.js +0 -367
- package/dist/src/yaml/steps/trim-align.test.d.ts +0 -11
- package/dist/src/yaml/steps/trim-align.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.test.js +0 -261
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts +0 -66
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.js +0 -251
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts +0 -13
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.js +0 -302
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts +0 -134
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.js +0 -173
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts +0 -11
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.test.js +0 -210
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts +0 -155
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.js +0 -1389
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts +0 -2
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +0 -1106
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts +0 -230
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.js +0 -1597
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts +0 -18
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.test.js +0 -1871
- package/dist/src/yaml/steps/xcode-app-product.d.ts +0 -90
- package/dist/src/yaml/steps/xcode-app-product.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.js +0 -247
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts +0 -2
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.test.js +0 -202
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts +0 -30
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-derived-data.test.js +0 -279
- package/dist/src/yaml/steps/xcode-destination.d.ts +0 -47
- package/dist/src/yaml/steps/xcode-destination.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.js +0 -202
- package/dist/src/yaml/steps/xcode-destination.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-destination.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.test.js +0 -227
- package/dist/src/yaml/steps/xcode-new.test.d.ts +0 -5
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-new.test.js +0 -211
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-resolve-retry.test.js +0 -146
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +0 -53
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.js +0 -98
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +0 -21
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.test.js +0 -155
- package/dist/src/yaml/steps/xcode.d.ts +0 -230
- package/dist/src/yaml/steps/xcode.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode.js +0 -1350
- package/dist/src/yaml/types.d.ts +0 -76
- package/dist/src/yaml/types.d.ts.map +0 -1
- package/dist/src/yaml/types.js +0 -5
- package/dist/src/yaml/validation-types.d.ts +0 -102
- package/dist/src/yaml/validation-types.d.ts.map +0 -1
- package/dist/src/yaml/validation-types.js +0 -8
- package/dist/src/yaml/yaml-updater.d.ts +0 -24
- package/dist/src/yaml/yaml-updater.d.ts.map +0 -1
- package/dist/src/yaml/yaml-updater.js +0 -128
package/dist/src/commands/run.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
-
import { extname, resolve } from "node:path";
|
|
3
|
-
import { pathToFileURL } from "node:url";
|
|
4
|
-
import prompts from "prompts";
|
|
5
|
-
import { PipelineRunner } from "../runner.js";
|
|
6
|
-
import { loadConfig } from "../config.js";
|
|
7
|
-
import { loadYAMLPipeline } from "../yaml/parser.js";
|
|
8
|
-
import { convertYAMLWithSecrets } from "../yaml/pipeline-with-secrets.js";
|
|
9
|
-
import { promptForWorkflow, promptForMissingVariables, isInteractiveTTY, } from "../shared/prompts.js";
|
|
10
|
-
/**
|
|
11
|
-
* Run a pipeline locally. Mirrors `ci run <path>`.
|
|
12
|
-
*
|
|
13
|
-
* - `.yml` / `.yaml` → parse, validate, optionally prompt for missing
|
|
14
|
-
* env vars, then execute via `PipelineRunner`.
|
|
15
|
-
* - `.ts` / `.js` → dynamic-import the module, use its default export
|
|
16
|
-
* as the `PipelineDef`, then execute.
|
|
17
|
-
*/
|
|
18
|
-
export async function handleRunCommand(opts = {}) {
|
|
19
|
-
const cwd = process.cwd();
|
|
20
|
-
// Resolve the pipeline path, optionally discovering from .ci/pipelines/.
|
|
21
|
-
let pipelinePath;
|
|
22
|
-
if (opts.pipelinePath) {
|
|
23
|
-
pipelinePath = resolve(cwd, opts.pipelinePath);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const pipelinesDir = resolve(cwd, ".ci", "pipelines");
|
|
27
|
-
if (!existsSync(pipelinesDir)) {
|
|
28
|
-
console.error("Project not initialised. Run 'ci init' first.");
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const yamlFiles = readdirSync(pipelinesDir).filter((f) => f.endsWith(".yml") || f.endsWith(".yaml"));
|
|
32
|
-
if (yamlFiles.length === 0) {
|
|
33
|
-
console.error("No pipelines found in .ci/pipelines/. Run 'ci init' to import one.");
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
if (yamlFiles.length === 1) {
|
|
37
|
-
pipelinePath = resolve(pipelinesDir, yamlFiles[0]);
|
|
38
|
-
console.log(`Using pipeline: ${yamlFiles[0]}`);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const { selected } = await prompts({
|
|
42
|
-
type: "select",
|
|
43
|
-
name: "selected",
|
|
44
|
-
message: "Select a pipeline to run:",
|
|
45
|
-
choices: yamlFiles.map((f) => ({ title: f, value: resolve(pipelinesDir, f) })),
|
|
46
|
-
});
|
|
47
|
-
if (!selected) {
|
|
48
|
-
console.log("Cancelled.");
|
|
49
|
-
process.exit(0);
|
|
50
|
-
}
|
|
51
|
-
pipelinePath = selected;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (!existsSync(pipelinePath)) {
|
|
55
|
-
console.error(`Error: Pipeline file not found: ${pipelinePath}`);
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const config = loadConfig();
|
|
60
|
-
config.local = opts.local ?? false;
|
|
61
|
-
const runner = new PipelineRunner(config);
|
|
62
|
-
const fileExt = extname(pipelinePath).toLowerCase();
|
|
63
|
-
const isYAML = fileExt === ".yml" || fileExt === ".yaml";
|
|
64
|
-
const isJavaScriptModule = fileExt === ".ts" || fileExt === ".js";
|
|
65
|
-
let pipeline;
|
|
66
|
-
if (isYAML) {
|
|
67
|
-
console.log(`Loading YAML pipeline: ${pipelinePath}`);
|
|
68
|
-
const yamlPipeline = loadYAMLPipeline(pipelinePath);
|
|
69
|
-
let selectedWorkflow = opts.workflow;
|
|
70
|
-
if (!selectedWorkflow) {
|
|
71
|
-
const workflows = Object.keys(yamlPipeline.workflows);
|
|
72
|
-
selectedWorkflow = await promptForWorkflow(workflows);
|
|
73
|
-
if (!selectedWorkflow) {
|
|
74
|
-
process.exit(1);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
console.log(`Using workflow: ${selectedWorkflow}`);
|
|
79
|
-
}
|
|
80
|
-
if (opts.skipValidation) {
|
|
81
|
-
console.log(`\n⏭️ Skipping validation (--skip-validation flag set)\n`);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
const canProceed = await promptForMissingVariables(yamlPipeline, selectedWorkflow, config, pipelinePath);
|
|
85
|
-
if (!canProceed) {
|
|
86
|
-
console.error("\n✗ Pipeline cannot run. Fix the errors above before continuing.");
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (opts.production) {
|
|
91
|
-
console.log("═".repeat(60));
|
|
92
|
-
console.log("🚀 PRODUCTION MODE");
|
|
93
|
-
console.log("═".repeat(60));
|
|
94
|
-
console.log("\nValidation passed. Pipeline would be dispatched to remote runner.");
|
|
95
|
-
console.log("(Remote runner integration not yet implemented)\n");
|
|
96
|
-
console.log("For now, use without --production flag to run locally.\n");
|
|
97
|
-
process.exit(0);
|
|
98
|
-
}
|
|
99
|
-
const conversionResult = await convertYAMLWithSecrets(yamlPipeline, {
|
|
100
|
-
config,
|
|
101
|
-
workflowName: selectedWorkflow,
|
|
102
|
-
yamlFilePath: pipelinePath,
|
|
103
|
-
// Only prompt when stdin/stdout are real TTYs. Sandboxed runs
|
|
104
|
-
// (Tart guest, CI, `tart exec`, pipes) have no terminal and
|
|
105
|
-
// MUST fail with a clear message rather than hang on a prompt.
|
|
106
|
-
interactive: isInteractiveTTY(),
|
|
107
|
-
});
|
|
108
|
-
pipeline = conversionResult.pipeline;
|
|
109
|
-
await runner.runPipeline(pipeline, conversionResult.warnings, conversionResult.skippedSteps, conversionResult.checkout);
|
|
110
|
-
}
|
|
111
|
-
else if (isJavaScriptModule) {
|
|
112
|
-
// The one dynamic import that has to stay dynamic: the specifier is a
|
|
113
|
-
// user-supplied path, so no bundler can inline it. That means this
|
|
114
|
-
// branch does NOT work in the `pkg`-built macOS binary — it throws
|
|
115
|
-
// `Invalid host defined options` before the module loads. Nothing
|
|
116
|
-
// reaches it today: every curated template is YAML, and the runner only
|
|
117
|
-
// ever executes YAML pipelines. If JS pipelines are ever exposed as a
|
|
118
|
-
// supported path, they need a loader that does not rely on `import()`.
|
|
119
|
-
console.log(`Loading pipeline: ${pipelinePath}`);
|
|
120
|
-
const pipelineUrl = pathToFileURL(pipelinePath).href;
|
|
121
|
-
const pipelineModule = await import(pipelineUrl);
|
|
122
|
-
pipeline = pipelineModule.default;
|
|
123
|
-
if (!pipeline || typeof pipeline !== "object") {
|
|
124
|
-
throw new Error("Pipeline file must export a default PipelineDef object");
|
|
125
|
-
}
|
|
126
|
-
await runner.runPipeline(pipeline);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
throw new Error(`Unsupported pipeline file format: ${fileExt}\n` +
|
|
130
|
-
`Supported formats: .yml, .yaml, .ts, .js`);
|
|
131
|
-
}
|
|
132
|
-
console.log("\n✓ All steps completed successfully!\n");
|
|
133
|
-
process.exit(0);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
console.error("\n✗ Pipeline failed:");
|
|
137
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
138
|
-
process.exit(1);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=run.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sync local .cibuild-secrets.json keys into a GitHub Actions workflow YAML.
|
|
3
|
-
*
|
|
4
|
-
* Updates the job `env:` block so the encoded secret names match exactly
|
|
5
|
-
* what `ci secrets upload` pushes to the GitHub environment.
|
|
6
|
-
*
|
|
7
|
-
* Also regenerates the node -e script that reconstructs .cibuild-secrets.json
|
|
8
|
-
* from the encoded environment variables.
|
|
9
|
-
*/
|
|
10
|
-
export interface SyncWorkflowOptions {
|
|
11
|
-
workflowPath: string;
|
|
12
|
-
dryRun: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare function handleSecretsSyncWorkflowCommand(options: SyncWorkflowOptions): Promise<void>;
|
|
15
|
-
//# sourceMappingURL=secrets-sync-workflow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-sync-workflow.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets-sync-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;CACjB;AAyFD,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAsNf"}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sync local .cibuild-secrets.json keys into a GitHub Actions workflow YAML.
|
|
3
|
-
*
|
|
4
|
-
* Updates the job `env:` block so the encoded secret names match exactly
|
|
5
|
-
* what `ci secrets upload` pushes to the GitHub environment.
|
|
6
|
-
*
|
|
7
|
-
* Also regenerates the node -e script that reconstructs .cibuild-secrets.json
|
|
8
|
-
* from the encoded environment variables.
|
|
9
|
-
*/
|
|
10
|
-
import * as fs from 'fs';
|
|
11
|
-
import { SecretsManager } from '../yaml/secrets-manager.js';
|
|
12
|
-
import { encodeSecretName } from './secrets-upload.js';
|
|
13
|
-
function collectEncodedSecrets(sm) {
|
|
14
|
-
const secrets = [];
|
|
15
|
-
// Global secrets
|
|
16
|
-
const globalSecrets = sm.getAll(); // no workflow → global only
|
|
17
|
-
for (const name of Object.keys(globalSecrets)) {
|
|
18
|
-
secrets.push({
|
|
19
|
-
encoded: encodeSecretName(name),
|
|
20
|
-
original: name,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
// Workflow-specific secrets
|
|
24
|
-
const data = sm.data;
|
|
25
|
-
for (const [workflow, vars] of Object.entries(data.workflows)) {
|
|
26
|
-
for (const name of Object.keys(vars)) {
|
|
27
|
-
secrets.push({
|
|
28
|
-
encoded: encodeSecretName(name, workflow),
|
|
29
|
-
original: name,
|
|
30
|
-
workflow,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return secrets;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Build the node -e script that reconstructs .cibuild-secrets.json from env vars.
|
|
38
|
-
*/
|
|
39
|
-
function buildSecretsScript(secrets) {
|
|
40
|
-
// Group secrets by workflow
|
|
41
|
-
const global = [];
|
|
42
|
-
const byWorkflow = new Map();
|
|
43
|
-
for (const s of secrets) {
|
|
44
|
-
if (s.workflow) {
|
|
45
|
-
if (!byWorkflow.has(s.workflow))
|
|
46
|
-
byWorkflow.set(s.workflow, []);
|
|
47
|
-
byWorkflow.get(s.workflow).push(s);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
global.push(s);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// Build the JSON object literal
|
|
54
|
-
const globalEntries = global
|
|
55
|
-
.map((s) => ` ...(process.env.${s.encoded} && { ${s.original}: process.env.${s.encoded} }),`)
|
|
56
|
-
.join('\n');
|
|
57
|
-
const workflowBlocks = [];
|
|
58
|
-
for (const [wf, wfSecrets] of byWorkflow) {
|
|
59
|
-
const entries = wfSecrets
|
|
60
|
-
.map((s) => ` ...(process.env.${s.encoded} && { ${s.original}: process.env.${s.encoded} }),`)
|
|
61
|
-
.join('\n');
|
|
62
|
-
workflowBlocks.push(` "${wf}": {\n${entries}\n }`);
|
|
63
|
-
}
|
|
64
|
-
const workflowsObj = workflowBlocks.length > 0
|
|
65
|
-
? `{\n${workflowBlocks.join(',\n')}\n }`
|
|
66
|
-
: '{}';
|
|
67
|
-
const globalObj = globalEntries
|
|
68
|
-
? `{\n${globalEntries}\n }`
|
|
69
|
-
: '{}';
|
|
70
|
-
return [
|
|
71
|
-
`node -e '`,
|
|
72
|
-
` const s = JSON.stringify({`,
|
|
73
|
-
` global: ${globalObj},`,
|
|
74
|
-
` workflows: ${workflowsObj}`,
|
|
75
|
-
` }, null, 2);`,
|
|
76
|
-
` require("fs").writeFileSync(process.argv[1], s);`,
|
|
77
|
-
` ' "$SECRETS_TMP"`,
|
|
78
|
-
].join('\n');
|
|
79
|
-
}
|
|
80
|
-
export async function handleSecretsSyncWorkflowCommand(options) {
|
|
81
|
-
const { workflowPath, dryRun } = options;
|
|
82
|
-
if (!fs.existsSync(workflowPath)) {
|
|
83
|
-
console.error(`Error: Workflow file not found: ${workflowPath}`);
|
|
84
|
-
process.exit(1);
|
|
85
|
-
}
|
|
86
|
-
const sm = new SecretsManager();
|
|
87
|
-
const allNames = sm.getAllSecretNames();
|
|
88
|
-
if (allNames.length === 0) {
|
|
89
|
-
console.error('Error: No secrets found. Use "ci secrets add" to add secrets first.');
|
|
90
|
-
process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
const encodedSecrets = collectEncodedSecrets(sm);
|
|
93
|
-
if (encodedSecrets.length === 0) {
|
|
94
|
-
console.log('No secrets to sync (all values are empty).');
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const content = fs.readFileSync(workflowPath, 'utf-8');
|
|
98
|
-
const lines = content.split('\n');
|
|
99
|
-
// --- Update env: block ---
|
|
100
|
-
// Find the env: block under the first job
|
|
101
|
-
let envBlockStart = -1;
|
|
102
|
-
let envBlockIndent = 0;
|
|
103
|
-
for (let i = 0; i < lines.length; i++) {
|
|
104
|
-
const match = lines[i].match(/^(\s+)env:\s*$/);
|
|
105
|
-
if (match) {
|
|
106
|
-
envBlockStart = i;
|
|
107
|
-
envBlockIndent = match[1].length;
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (envBlockStart === -1) {
|
|
112
|
-
// No env: block found — insert one before the first job's `steps:` line
|
|
113
|
-
for (let i = 0; i < lines.length; i++) {
|
|
114
|
-
const stepsMatch = lines[i].match(/^(\s+)steps:\s*$/);
|
|
115
|
-
if (stepsMatch) {
|
|
116
|
-
envBlockIndent = stepsMatch[1].length;
|
|
117
|
-
const pad = ' '.repeat(envBlockIndent);
|
|
118
|
-
const entryPad = ' '.repeat(envBlockIndent + 2);
|
|
119
|
-
const envLine = `${pad}env:`;
|
|
120
|
-
const secretLines = encodedSecrets.map((s) => `${entryPad}${s.encoded}: \${{ secrets.${s.encoded} }}`);
|
|
121
|
-
lines.splice(i, 0, envLine, ...secretLines);
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const newContent = lines.join('\n');
|
|
126
|
-
if (dryRun) {
|
|
127
|
-
console.log(`\nDry run — would add env: block with ${encodedSecrets.length} secret(s) to ${workflowPath}\n`);
|
|
128
|
-
console.log('Run without --dry-run to apply changes.');
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
fs.writeFileSync(workflowPath, newContent, 'utf-8');
|
|
132
|
-
console.log(`\n✅ Added env: block with ${encodedSecrets.length} secret(s) to ${workflowPath}`);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
// Find the extent of the env block (lines with indentation > envBlockIndent)
|
|
136
|
-
const entryIndent = envBlockIndent + 2;
|
|
137
|
-
let envBlockEnd = envBlockStart + 1;
|
|
138
|
-
while (envBlockEnd < lines.length) {
|
|
139
|
-
const line = lines[envBlockEnd];
|
|
140
|
-
// Empty lines could be inside the block or trailing — peek ahead
|
|
141
|
-
if (line.trim() === '') {
|
|
142
|
-
// Check if there's a non-empty line after this that's still in the block
|
|
143
|
-
let nextNonEmpty = envBlockEnd + 1;
|
|
144
|
-
while (nextNonEmpty < lines.length && lines[nextNonEmpty].trim() === '') {
|
|
145
|
-
nextNonEmpty++;
|
|
146
|
-
}
|
|
147
|
-
if (nextNonEmpty < lines.length) {
|
|
148
|
-
const nextIndent = lines[nextNonEmpty].match(/^(\s*)/)?.[1].length ?? 0;
|
|
149
|
-
if (nextIndent > envBlockIndent) {
|
|
150
|
-
// Still inside the block — include this blank line
|
|
151
|
-
envBlockEnd++;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// Trailing blank line(s) — don't consume them
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
// Check indentation — if it's at or below the env: level, we're past the block
|
|
159
|
-
const lineIndent = line.match(/^(\s*)/)?.[1].length ?? 0;
|
|
160
|
-
if (lineIndent <= envBlockIndent)
|
|
161
|
-
break;
|
|
162
|
-
envBlockEnd++;
|
|
163
|
-
}
|
|
164
|
-
// Build set of original secret names to remove old non-encoded entries
|
|
165
|
-
const originalSecretNames = new Set(encodedSecrets.map((s) => s.original));
|
|
166
|
-
// Collect existing non-secret env entries (keep them, including blank lines)
|
|
167
|
-
const existingEntries = [];
|
|
168
|
-
for (let i = envBlockStart + 1; i < envBlockEnd; i++) {
|
|
169
|
-
const line = lines[i];
|
|
170
|
-
// Preserve blank lines between entries
|
|
171
|
-
if (line.trim() === '') {
|
|
172
|
-
existingEntries.push(line);
|
|
173
|
-
continue;
|
|
174
|
-
}
|
|
175
|
-
// Remove old CIBUILD_S__ / CIBUILD_SW__ entries (we'll regenerate them)
|
|
176
|
-
if (line.match(/^\s+CIBUILD_S(W)?__/))
|
|
177
|
-
continue;
|
|
178
|
-
// Remove old non-encoded entries that match a known secret name
|
|
179
|
-
const keyMatch = line.match(/^\s+(\w+):\s/);
|
|
180
|
-
if (keyMatch && originalSecretNames.has(keyMatch[1]))
|
|
181
|
-
continue;
|
|
182
|
-
existingEntries.push(line);
|
|
183
|
-
}
|
|
184
|
-
// Trim trailing blank lines from existing entries (we add a clean separator)
|
|
185
|
-
while (existingEntries.length > 0 && existingEntries[existingEntries.length - 1].trim() === '') {
|
|
186
|
-
existingEntries.pop();
|
|
187
|
-
}
|
|
188
|
-
// Build new secret entries
|
|
189
|
-
const pad = ' '.repeat(entryIndent);
|
|
190
|
-
const newSecretLines = encodedSecrets.map((s) => `${pad}${s.encoded}: \${{ secrets.${s.encoded} }}`);
|
|
191
|
-
// Reassemble
|
|
192
|
-
const newEnvBlock = [
|
|
193
|
-
lines[envBlockStart], // " env:"
|
|
194
|
-
...existingEntries,
|
|
195
|
-
...newSecretLines,
|
|
196
|
-
];
|
|
197
|
-
// --- Update node -e script ---
|
|
198
|
-
// Find the node -e block that builds .cibuild-secrets.json
|
|
199
|
-
let nodeScriptStart = -1;
|
|
200
|
-
let nodeScriptEnd = -1;
|
|
201
|
-
for (let i = 0; i < lines.length; i++) {
|
|
202
|
-
if (lines[i].match(/node\s+-e\s+'/)) {
|
|
203
|
-
nodeScriptStart = i;
|
|
204
|
-
}
|
|
205
|
-
if (nodeScriptStart !== -1 && nodeScriptEnd === -1 && lines[i].match(/'\s+"\$SECRETS_TMP"/)) {
|
|
206
|
-
nodeScriptEnd = i + 1;
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
// Splice the file back together
|
|
211
|
-
const result = [];
|
|
212
|
-
for (let i = 0; i < lines.length; i++) {
|
|
213
|
-
if (i >= envBlockStart && i < envBlockEnd) {
|
|
214
|
-
if (i === envBlockStart) {
|
|
215
|
-
result.push(...newEnvBlock);
|
|
216
|
-
}
|
|
217
|
-
// skip old lines
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
if (nodeScriptStart !== -1 && i >= nodeScriptStart && i < nodeScriptEnd) {
|
|
221
|
-
if (i === nodeScriptStart) {
|
|
222
|
-
// Rebuild node script with encoded env var names
|
|
223
|
-
result.push(`${' '.repeat(10)}${buildSecretsScript(encodedSecrets)}`);
|
|
224
|
-
}
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
result.push(lines[i]);
|
|
228
|
-
}
|
|
229
|
-
const newContent = result.join('\n');
|
|
230
|
-
if (dryRun) {
|
|
231
|
-
console.log(`\nDry run — would sync ${encodedSecrets.length} secret(s) to ${workflowPath}:\n`);
|
|
232
|
-
for (const s of encodedSecrets) {
|
|
233
|
-
const label = s.workflow
|
|
234
|
-
? `workflow:${s.workflow} → ${s.original}`
|
|
235
|
-
: `global → ${s.original}`;
|
|
236
|
-
console.log(` ${label} → ${s.encoded}`);
|
|
237
|
-
}
|
|
238
|
-
console.log(`\nEnv block preview:\n`);
|
|
239
|
-
for (const line of newEnvBlock) {
|
|
240
|
-
console.log(line);
|
|
241
|
-
}
|
|
242
|
-
console.log('\nRun without --dry-run to apply changes.');
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
fs.writeFileSync(workflowPath, newContent, 'utf-8');
|
|
246
|
-
console.log(`\n✅ Synced ${encodedSecrets.length} secret(s) to ${workflowPath}\n`);
|
|
247
|
-
for (const s of encodedSecrets) {
|
|
248
|
-
const label = s.workflow
|
|
249
|
-
? `workflow:${s.workflow} → ${s.original}`
|
|
250
|
-
: `global → ${s.original}`;
|
|
251
|
-
console.log(` ${label} → ${s.encoded}`);
|
|
252
|
-
}
|
|
253
|
-
console.log('');
|
|
254
|
-
}
|
|
255
|
-
//# sourceMappingURL=secrets-sync-workflow.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Upload local .cibuild-secrets.json to GitHub Secrets (in a GitHub environment).
|
|
3
|
-
*
|
|
4
|
-
* Encoding scheme:
|
|
5
|
-
* global secret "VAR" → CIBUILD_S__VAR
|
|
6
|
-
* workflow "my-wf" secret "VAR" → CIBUILD_SW__MY_WF__VAR
|
|
7
|
-
*
|
|
8
|
-
* Uses `gh` CLI for all GitHub API interactions.
|
|
9
|
-
*/
|
|
10
|
-
export declare function encodeSecretName(varName: string, workflow?: string): string;
|
|
11
|
-
export declare function decodeSecretName(encoded: string): {
|
|
12
|
-
varName: string;
|
|
13
|
-
workflow?: string;
|
|
14
|
-
} | null;
|
|
15
|
-
export interface SecretsUploadOptions {
|
|
16
|
-
envName: string;
|
|
17
|
-
repo?: string;
|
|
18
|
-
dryRun: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare function handleSecretsUploadCommand(options: SecretsUploadOptions): Promise<void>;
|
|
21
|
-
//# sourceMappingURL=secrets-upload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-upload.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM3E;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiB/F;AAwDD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqF7F"}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Upload local .cibuild-secrets.json to GitHub Secrets (in a GitHub environment).
|
|
3
|
-
*
|
|
4
|
-
* Encoding scheme:
|
|
5
|
-
* global secret "VAR" → CIBUILD_S__VAR
|
|
6
|
-
* workflow "my-wf" secret "VAR" → CIBUILD_SW__MY_WF__VAR
|
|
7
|
-
*
|
|
8
|
-
* Uses `gh` CLI for all GitHub API interactions.
|
|
9
|
-
*/
|
|
10
|
-
import { execSync } from 'child_process';
|
|
11
|
-
import { existsSync } from 'fs';
|
|
12
|
-
import { resolve } from 'path';
|
|
13
|
-
import { SecretsManager } from '../yaml/secrets-manager.js';
|
|
14
|
-
import { handleSecretsSyncWorkflowCommand } from './secrets-sync-workflow.js';
|
|
15
|
-
const GLOBAL_PREFIX = 'CIBUILD_S__';
|
|
16
|
-
const WORKFLOW_PREFIX = 'CIBUILD_SW__';
|
|
17
|
-
export function encodeSecretName(varName, workflow) {
|
|
18
|
-
if (workflow) {
|
|
19
|
-
const encodedWorkflow = workflow.toUpperCase().replace(/-/g, '_');
|
|
20
|
-
return `${WORKFLOW_PREFIX}${encodedWorkflow}__${varName}`;
|
|
21
|
-
}
|
|
22
|
-
return `${GLOBAL_PREFIX}${varName}`;
|
|
23
|
-
}
|
|
24
|
-
export function decodeSecretName(encoded) {
|
|
25
|
-
if (encoded.startsWith(WORKFLOW_PREFIX)) {
|
|
26
|
-
const rest = encoded.slice(WORKFLOW_PREFIX.length);
|
|
27
|
-
const sepIdx = rest.indexOf('__');
|
|
28
|
-
if (sepIdx === -1)
|
|
29
|
-
return null;
|
|
30
|
-
const encodedWorkflow = rest.slice(0, sepIdx);
|
|
31
|
-
const varName = rest.slice(sepIdx + 2);
|
|
32
|
-
if (!varName)
|
|
33
|
-
return null;
|
|
34
|
-
const workflow = encodedWorkflow.toLowerCase().replace(/_/g, '-');
|
|
35
|
-
return { varName, workflow };
|
|
36
|
-
}
|
|
37
|
-
if (encoded.startsWith(GLOBAL_PREFIX)) {
|
|
38
|
-
const varName = encoded.slice(GLOBAL_PREFIX.length);
|
|
39
|
-
if (!varName)
|
|
40
|
-
return null;
|
|
41
|
-
return { varName };
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
function ensureGhCli() {
|
|
46
|
-
try {
|
|
47
|
-
execSync('gh --version', { stdio: 'pipe' });
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
console.error('Error: GitHub CLI (gh) is required.');
|
|
51
|
-
console.error(' macOS: brew install gh');
|
|
52
|
-
console.error(' Other: https://cli.github.com/');
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
execSync('gh auth status', { stdio: 'pipe' });
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
console.error('Error: Not authenticated with GitHub CLI. Run "gh auth login" first.');
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function getRepo(repoArg) {
|
|
64
|
-
if (repoArg)
|
|
65
|
-
return repoArg;
|
|
66
|
-
try {
|
|
67
|
-
const result = execSync('gh repo view --json nameWithOwner -q .nameWithOwner', {
|
|
68
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
69
|
-
encoding: 'utf-8',
|
|
70
|
-
});
|
|
71
|
-
return result.trim();
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
console.error('Error: Could not detect repository. Use --repo <owner/repo> or run from a git repo.');
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function ensureEnvironment(repo, envName) {
|
|
79
|
-
try {
|
|
80
|
-
execSync(`gh api -X PUT repos/${repo}/environments/${envName}`, { stdio: 'pipe' });
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
console.error(`Error: Could not create environment "${envName}". Check that you have admin access to ${repo}.`);
|
|
84
|
-
if (err instanceof Error)
|
|
85
|
-
console.error(err.message);
|
|
86
|
-
process.exit(1);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function uploadSecret(repo, envName, name, value) {
|
|
90
|
-
try {
|
|
91
|
-
execSync(`gh secret set ${name} --env ${envName} --repo ${repo}`, {
|
|
92
|
-
input: value,
|
|
93
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
94
|
-
});
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
catch (err) {
|
|
98
|
-
console.error(` Failed to upload "${name}": ${err instanceof Error ? err.message : String(err)}`);
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
export async function handleSecretsUploadCommand(options) {
|
|
103
|
-
const { envName, dryRun } = options;
|
|
104
|
-
if (!dryRun) {
|
|
105
|
-
ensureGhCli();
|
|
106
|
-
}
|
|
107
|
-
const sm = new SecretsManager();
|
|
108
|
-
const allNames = sm.getAllSecretNames();
|
|
109
|
-
if (allNames.length === 0) {
|
|
110
|
-
console.error('Error: No secrets found. Use "ci secrets add" to add secrets first.');
|
|
111
|
-
process.exit(1);
|
|
112
|
-
}
|
|
113
|
-
// Build list of encoded secrets to upload
|
|
114
|
-
const toUpload = [];
|
|
115
|
-
// Global secrets
|
|
116
|
-
const globalSecrets = sm.getAll(); // no workflow → global only
|
|
117
|
-
for (const [name, value] of Object.entries(globalSecrets)) {
|
|
118
|
-
if (!value)
|
|
119
|
-
continue;
|
|
120
|
-
toUpload.push({
|
|
121
|
-
encoded: encodeSecretName(name),
|
|
122
|
-
value,
|
|
123
|
-
label: `global → ${name}`,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
// Workflow-specific secrets (only those that differ from global)
|
|
127
|
-
const data = sm.data;
|
|
128
|
-
for (const [workflow, vars] of Object.entries(data.workflows)) {
|
|
129
|
-
if (workflow.includes('_')) {
|
|
130
|
-
console.warn(` Warning: Workflow "${workflow}" contains underscores, which may cause ambiguity when decoding.`);
|
|
131
|
-
}
|
|
132
|
-
for (const [name, value] of Object.entries(vars)) {
|
|
133
|
-
if (!value)
|
|
134
|
-
continue;
|
|
135
|
-
toUpload.push({
|
|
136
|
-
encoded: encodeSecretName(name, workflow),
|
|
137
|
-
value,
|
|
138
|
-
label: `workflow:${workflow} → ${name}`,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (toUpload.length === 0) {
|
|
143
|
-
console.log('No secrets to upload (all values are empty).');
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const repo = dryRun ? (options.repo || '<auto-detected>') : getRepo(options.repo);
|
|
147
|
-
if (dryRun) {
|
|
148
|
-
console.log(`\nDry run — would upload ${toUpload.length} secret(s) to environment "${envName}" in ${repo}:\n`);
|
|
149
|
-
for (const s of toUpload) {
|
|
150
|
-
console.log(` ${s.label} → ${s.encoded}`);
|
|
151
|
-
}
|
|
152
|
-
console.log('\nRun without --dry-run to upload.');
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
console.log(`\nUploading ${toUpload.length} secret(s) to environment "${envName}" in ${repo}...\n`);
|
|
156
|
-
ensureEnvironment(repo, envName);
|
|
157
|
-
let failed = 0;
|
|
158
|
-
for (const s of toUpload) {
|
|
159
|
-
process.stdout.write(` ${s.label} → ${s.encoded} ... `);
|
|
160
|
-
if (uploadSecret(repo, envName, s.encoded, s.value)) {
|
|
161
|
-
console.log('✓');
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
failed++;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
console.log(`\nDone. ${toUpload.length - failed}/${toUpload.length} secrets uploaded.`);
|
|
168
|
-
if (failed > 0) {
|
|
169
|
-
process.exit(1);
|
|
170
|
-
}
|
|
171
|
-
// Auto-sync workflow if .github/workflows/ci.yml exists
|
|
172
|
-
const workflowPath = resolve(process.cwd(), '.github', 'workflows', 'ci.yml');
|
|
173
|
-
if (existsSync(workflowPath)) {
|
|
174
|
-
await handleSecretsSyncWorkflowCommand({ workflowPath, dryRun: false });
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
//# sourceMappingURL=secrets-upload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-upload.test.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets-upload.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|