From e60d9b3688d365b45dd8d133d52b3cac8250a1e0 Mon Sep 17 00:00:00 2001 From: Simon Planinschek Date: Fri, 7 Mar 2025 12:21:01 +0100 Subject: [PATCH 1/2] allow namespace to be specified when upgrading to make sure the chart is installed in the correct namespace --- helm-deploy/action.yml | 4 ++++ readme.md | 27 ++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/helm-deploy/action.yml b/helm-deploy/action.yml index 9c0cde0..9c0060b 100644 --- a/helm-deploy/action.yml +++ b/helm-deploy/action.yml @@ -23,6 +23,9 @@ inputs: release-name: description: "The name of the Helm release" required: true + namespace: + description: "The namespace in which to deploy the Helm chart and application" + required: true values-file: description: "Path to the Helm values file" required: true @@ -71,6 +74,7 @@ runs: working-directory: ${{ inputs.working-directory }} run: | helm upgrade --wait --install ${{ inputs.release-name }} ./${{ inputs.helm-package }} \ + --namespace ${{ inputs.namespace }} --values ${{ inputs.values-file }} \ --atomic --timeout ${{ inputs.timeout }} \ --set image.tag=${{ inputs.image-tag }} diff --git a/readme.md b/readme.md index 134430b..bf0849d 100644 --- a/readme.md +++ b/readme.md @@ -77,19 +77,20 @@ Deploy an application to a Kubernetes cluster using its Helm chart. Requires Kub The following inputs can be used as `step.with` keys: -| Name | Required/Default | Description | -|----------------------|------------------|--------------------------------------------------------------| -| `helm-chart-version` | required | The version of the Helm chart to pull | -| `helm-registry-url` | required | The URL of the Helm OCI registry | -| `helm-package` | required | The name of the Helm package to pull | -| `helm-username` | required | The username for authenticating with the Helm registry | -| `helm-password` | required | The password for authenticating with the Helm registry | -| `helm-protocol` | `oci://` | The protocol for pulling Helm charts (e.g., `oci://`) | -| `release-name` | required | The name of the Helm release | -| `values-file` | required | Path to the Helm values file for customization | -| `image-tag` | `latest` | The tag of the container image to set | -| `timeout` | `5m` | The timeout for the Helm command | -| `working-directory` | `.` | The working directory where the action commands will operate | +| Name | Required/Default | Description | +|----------------------|------------------|------------------------------------------------------------------| +| `helm-chart-version` | required | The version of the Helm chart to pull | +| `helm-registry-url` | required | The URL of the Helm OCI registry | +| `helm-package` | required | The name of the Helm package to pull | +| `helm-username` | required | The username for authenticating with the Helm registry | +| `helm-password` | required | The password for authenticating with the Helm registry | +| `helm-protocol` | `oci://` | The protocol for pulling Helm charts (e.g., `oci://`) | +| `release-name` | required | The name of the Helm release | +| `namespace` | required | The namespace in which to deploy the Helm chart and application. | +| `values-file` | required | Path to the Helm values file for customization | +| `image-tag` | `latest` | The tag of the container image to set | +| `timeout` | `5m` | The timeout for the Helm command | +| `working-directory` | `.` | The working directory where the action commands will operate | ## Versioning From d7e952a000c644ce502b8d8bb26cc78ac67e8dba Mon Sep 17 00:00:00 2001 From: Simon Planinschek Date: Fri, 7 Mar 2025 14:41:38 +0100 Subject: [PATCH 2/2] add missing line continuation character --- helm-deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-deploy/action.yml b/helm-deploy/action.yml index 9c0060b..bdced75 100644 --- a/helm-deploy/action.yml +++ b/helm-deploy/action.yml @@ -74,7 +74,7 @@ runs: working-directory: ${{ inputs.working-directory }} run: | helm upgrade --wait --install ${{ inputs.release-name }} ./${{ inputs.helm-package }} \ - --namespace ${{ inputs.namespace }} + --namespace ${{ inputs.namespace }} \ --values ${{ inputs.values-file }} \ --atomic --timeout ${{ inputs.timeout }} \ --set image.tag=${{ inputs.image-tag }}