Skip to content

Commit 5136c65

Browse files
committed
workflow and resolver bugfix
1 parent 0a989ac commit 5136c65

5 files changed

Lines changed: 22 additions & 9 deletions

File tree

actions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ GitHub Actions for automating Salesforce B2C Commerce operations with the [`@sal
4747
client-secret: ${{ secrets.SFCC_CLIENT_SECRET }}
4848
server: ${{ vars.SFCC_SERVER }}
4949
code-version: ${{ vars.SFCC_CODE_VERSION }}
50-
reload: true
50+
activate: true
5151
cartridges: 'app_storefront_base,app_custom'
5252
```
5353

actions/code-deploy/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ inputs:
99
description: 'Path to cartridge source directory'
1010
required: false
1111
default: '.'
12+
activate:
13+
description: 'Activate the code version after deploy'
14+
required: false
15+
default: 'false'
1216
reload:
13-
description: 'Activate/reload the code version after deploy'
17+
description: 'Alias for activate (deprecated)'
1418
required: false
15-
default: 'true'
19+
default: 'false'
1620
code-version:
1721
description: 'Code version to deploy to (overrides SFCC_CODE_VERSION env var)'
1822
required: false
@@ -81,7 +85,7 @@ runs:
8185
run: |
8286
CMD="code deploy ${{ inputs.cartridge-path }}"
8387
84-
if [ "${{ inputs.reload }}" = "true" ]; then
88+
if [ "${{ inputs.activate }}" = "true" ] || [ "${{ inputs.reload }}" = "true" ]; then
8589
CMD="$CMD --reload"
8690
fi
8791

actions/workflow-templates/b2c-code-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
username: ${{ secrets.SFCC_USERNAME }}
1919
password: ${{ secrets.SFCC_PASSWORD }}
2020
code-version: ${{ vars.SFCC_CODE_VERSION }}
21-
reload: true
21+
activate: true

docs/guide/ci-cd.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The official actions handle CLI installation, credential configuration, and Node
88

99
The actions are available from the `SalesforceCommerceCloud/b2c-developer-tooling` repository and support:
1010

11-
- **Code deployment** — deploy cartridges with reload
11+
- **Code deployment** — deploy and activate cartridges
1212
- **Data import** — import site archives in a single step
1313
- **MRT deployment** — push and deploy MRT storefront bundles
1414
- **Job execution** — run B2C jobs with wait and timeout
@@ -80,7 +80,7 @@ jobs:
8080
- uses: SalesforceCommerceCloud/b2c-developer-tooling/actions/code-deploy@v1
8181
with:
8282
code-version: ${{ steps.version.outputs.code-version }}
83-
reload: true
83+
activate: true
8484
```
8585
8686
The **setup** step installs the CLI and configures credentials for all subsequent steps. Everything after that — your build, version calculation, and deploy — can focus on your project's needs.
@@ -169,7 +169,7 @@ Deploy cartridges with typed inputs.
169169
| Input | Default | Description |
170170
|-------|---------|-------------|
171171
| `cartridge-path` | `.` | Path to cartridge source directory |
172-
| `reload` | `true` | Activate code version after deploy |
172+
| `activate` | `false` | Activate code version after deploy |
173173
| `code-version` || Code version (overrides env) |
174174
| `cartridges` || Comma-separated cartridges to include |
175175
| `exclude-cartridges` || Comma-separated cartridges to exclude |

packages/b2c-tooling-sdk/src/config/resolver.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ export class ConfigResolver {
177177
// CLI-provided options always take precedence over accumulated values.
178178
const enrichedOptions: ResolveConfigOptions = {...options};
179179

180+
// Seed enriched options from overrides (CLI flags) so that all sources—including
181+
// the first one—can see CLI-provided values like accountManagerHost.
182+
if (!enrichedOptions.accountManagerHost && overrides.accountManagerHost) {
183+
enrichedOptions.accountManagerHost = overrides.accountManagerHost;
184+
}
185+
if (!enrichedOptions.cloudOrigin && overrides.mrtOrigin) {
186+
enrichedOptions.cloudOrigin = normalizeOriginUrl(overrides.mrtOrigin);
187+
}
188+
180189
// Load from each source in order, merging results
181190
// Earlier sources have higher priority - later sources only fill in missing values
182191
for (const source of this.sources) {
@@ -283,7 +292,7 @@ export class ConfigResolver {
283292
);
284293

285294
// Enrich options with accumulated config values for subsequent sources.
286-
// Only set if not already provided via CLI options.
295+
// Only set if not already provided via CLI options or overrides.
287296
if (!enrichedOptions.accountManagerHost && baseConfig.accountManagerHost) {
288297
enrichedOptions.accountManagerHost = baseConfig.accountManagerHost;
289298
}

0 commit comments

Comments
 (0)