Skip to content

Commit

Permalink
Add is-dev-mode-enabled flag for customer create action
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin committed Jan 3, 2025
1 parent a4190eb commit 7ed8b5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions create-customer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ channel_slug["channel-slug"]
expires_in["expires-in"]
entitlements["entitlements"]
is_kots_install_enabled["is-kots-install-enabled"]
is_dev_mode_enabled["is-dev-mode-enabled"]
customer_id["customer-id"]
license_id["license-id"]
license_file["license-file"]
Expand All @@ -27,6 +28,7 @@ channel_slug ---> create_customer
expires_in ---> create_customer
entitlements ---> create_customer
is_kots_install_enabled ---> create_customer
is_dev_mode_enabled ---> create_customer
create_customer ---> customer_id
create_customer ---> license_id
create_customer ---> license_file
Expand All @@ -43,6 +45,7 @@ create_customer ---> license_file
| expires-in | 0 | False | Expiration of the license in days. (default: 0 - never expires)) |
| entitlements | | False | Entitlements to assign to the customer.<br>Example:<br><pre>entitlements: \|<br> - name: "number-of-users"<br> value: "10"</pre><br> |
| is-kots-install-enabled | | False | If KOTS install should be enabled for the customer. |
| is-dev-mode-enabled | | False | If Dev Mode should be enabled for the customer. Can only be enabled for dev licenses. |

## Outputs
| Name | Description |
Expand Down
3 changes: 3 additions & 0 deletions create-customer/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ inputs:
is-kots-install-enabled:
description: "If KOTS install should be enabled for the customer."
required: false
is-dev-mode-enabled:
description: "If Dev Mode should be enabled for the customer. Can only be enabled for dev licenses."
required: false
outputs:
customer-id: # id of the customer
description: "Contains the customer id."
Expand Down
8 changes: 7 additions & 1 deletion src/create-customer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export async function actionCreateCustomer() {
isKotsInstallEnabled =
core.getInput("is-kots-install-enabled") === "true";
}

let isDevModeEnabled: boolean | undefined = undefined;
if (core.getInput("is-dev-mode-enabled") !== "") {
isDevModeEnabled =
core.getInput("is-dev-mode-enabled") === "true";
}

const apiClient = new VendorPortalApi();
apiClient.apiToken = apiToken;
Expand All @@ -31,7 +37,7 @@ export async function actionCreateCustomer() {
}

const entitlementsArray = processEntitlements(entitlements)
const customer = await createCustomer(apiClient, appSlug, name, email, licenseType, channelSlug, expiresInDays, entitlementsArray, isKotsInstallEnabled);
const customer = await createCustomer(apiClient, appSlug, name, email, licenseType, channelSlug, expiresInDays, entitlementsArray, isKotsInstallEnabled, isDevModeEnabled);

core.setOutput('customer-id', customer.customerId);
core.setOutput('license-id', customer.licenseId);
Expand Down

0 comments on commit 7ed8b5b

Please sign in to comment.