From 0244f72d9af14e5aba127fcd000dec29257cd0da Mon Sep 17 00:00:00 2001 From: Wouter Polet Date: Fri, 21 Oct 2022 14:35:57 +0200 Subject: [PATCH 1/3] Add an argument to include --dependency-update to helm command --- action.yml | 3 +++ index.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/action.yml b/action.yml index 1f10f04..95ca43f 100644 --- a/action.yml +++ b/action.yml @@ -53,6 +53,9 @@ inputs: tag-fields: description: Fields to insert the image tags in. Expects JSON encoded array or a string. Defaults to "image.tag". required: false + dependency-update: + description: Boolean whether helm should automatically download dependencies. Might not be supported by all helm versions. + required: false runs: using: docker image: Dockerfile diff --git a/index.js b/index.js index ef81656..3fe7c3d 100644 --- a/index.js +++ b/index.js @@ -48,6 +48,7 @@ const run = async () => { let imageFields = parseJsonList(core.getInput("image-fields")); const tag = core.getInput("tag"); let tagFields = parseJsonList(core.getInput("tag-fields")); + const dependencyUpdate = core.getInput("dependency-update"); core.debug(`param: release = "${release}"`); core.debug(`param: namespace = "${namespace}"`); @@ -65,6 +66,7 @@ const run = async () => { core.debug(`param: imageFields = "${JSON.stringify(imageFields)}"`) core.debug(`param: tag = "${tag}"`); core.debug(`param: tagFields = "${JSON.stringify(tagFields)}"`) + core.debug(`param: dependencyUpdate = ${dependencyUpdate}`) const args = [ "upgrade", @@ -129,6 +131,10 @@ const run = async () => { ); } + if (dependencyUpdate) { + args.push("--dependency-update") + } + if (task === "remove") { // Delete the deployment await exec.exec("helm", ["delete", "-n", namespace, release], { From 4f368e2b873c7c54add474ba1f701891b22ccc41 Mon Sep 17 00:00:00 2001 From: Wouter Polet Date: Fri, 21 Oct 2022 14:47:53 +0200 Subject: [PATCH 2/3] Add --dependency-update by default --- action.yml | 3 --- index.js | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 95ca43f..1f10f04 100644 --- a/action.yml +++ b/action.yml @@ -53,9 +53,6 @@ inputs: tag-fields: description: Fields to insert the image tags in. Expects JSON encoded array or a string. Defaults to "image.tag". required: false - dependency-update: - description: Boolean whether helm should automatically download dependencies. Might not be supported by all helm versions. - required: false runs: using: docker image: Dockerfile diff --git a/index.js b/index.js index 3fe7c3d..c8b479e 100644 --- a/index.js +++ b/index.js @@ -48,7 +48,6 @@ const run = async () => { let imageFields = parseJsonList(core.getInput("image-fields")); const tag = core.getInput("tag"); let tagFields = parseJsonList(core.getInput("tag-fields")); - const dependencyUpdate = core.getInput("dependency-update"); core.debug(`param: release = "${release}"`); core.debug(`param: namespace = "${namespace}"`); @@ -66,7 +65,6 @@ const run = async () => { core.debug(`param: imageFields = "${JSON.stringify(imageFields)}"`) core.debug(`param: tag = "${tag}"`); core.debug(`param: tagFields = "${JSON.stringify(tagFields)}"`) - core.debug(`param: dependencyUpdate = ${dependencyUpdate}`) const args = [ "upgrade", @@ -75,6 +73,7 @@ const run = async () => { "--install", "--wait", `--namespace=${namespace}`, + "--dependency-update" ]; // Per https://helm.sh/docs/faq/#xdg-base-directory-support @@ -131,10 +130,6 @@ const run = async () => { ); } - if (dependencyUpdate) { - args.push("--dependency-update") - } - if (task === "remove") { // Delete the deployment await exec.exec("helm", ["delete", "-n", namespace, release], { From d09aa7de3b9f42912712969404ddb48efc13ee93 Mon Sep 17 00:00:00 2001 From: Wouter Polet Date: Fri, 21 Oct 2022 15:03:10 +0200 Subject: [PATCH 3/3] Update helm file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 27e65dd..a958168 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.13 ENV BASE_URL="https://get.helm.sh" -ENV HELM_FILE="helm-v3.5.3-linux-amd64.tar.gz" +ENV HELM_FILE="helm-v3.10.0-linux-amd64.tar.gz" RUN apk add --no-cache ca-certificates \ --repository http://dl-3.alpinelinux.org/alpine/edge/community/ \