diff --git a/README.md b/README.md index 4526bfc..ece8024 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Inputs: * `chart_version` Explicitly specify chart version in package. If not defined then used chart values. * `index_dir` The location of `index.yaml` file in the repo, defaults to the same value as `target_dir` * `enterprise_url` The URL of enterprise github server in the format `/` +* `dependencies` A list of helm repositories required to verify dependencies in the format `,;,` ## Examples diff --git a/action.yml b/action.yml index e8209e9..807bc23 100644 --- a/action.yml +++ b/action.yml @@ -51,7 +51,10 @@ inputs: required: false enterprise_url: description: "The URL of enterprise github server in the format '/'" - required: false + required: false + dependencies: + description: "A list of helm repositories required to verify dependencies in the format ',;,'" + required: false runs: using: 'docker' image: 'Dockerfile' @@ -71,3 +74,4 @@ runs: - ${{ inputs.chart_version }} - ${{ inputs.index_dir }} - ${{ inputs.enterprise_url }} + - ${{ inputs.dependencies }} diff --git a/src/entrypoint.sh b/src/entrypoint.sh index 8503afa..e720cd2 100644 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -32,6 +32,7 @@ APP_VERSION=${12} CHART_VERSION=${13} INDEX_DIR=${14} ENTERPRISE_URL=${15} +DEPENDENCIES=${16} CHARTS=() CHARTS_TMP_DIR=$(mktemp -d) @@ -93,6 +94,7 @@ main() { locate download + get_dependencies dependencies if [[ "$LINTING" != "off" ]]; then lint @@ -124,6 +126,15 @@ download() { rm -rf $tmpDir } +get_dependencies() { + IFS=';' read -ra dependency <<< "$DEPENDENCIES" + for repos in ${dependency[@]}; do + name=$(cut -f 1 -d, <<< "$repos") + url=$(cut -f 2 -d, <<< "$repos") + helm repo add ${name} ${url} + done +} + dependencies() { for chart in ${CHARTS[@]}; do helm dependency update "${chart}"