Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for alias:<repo name> in dependencies check #32

Merged
merged 9 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<server-url>/<organisation>`
* `dependencies` A list of helm repositories required to verify dependencies in the format `<name>,<url>;<name>,<url>`

## Examples

Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ inputs:
required: false
enterprise_url:
description: "The URL of enterprise github server in the format '<server-url>/<organisation>'"
required: false
required: false
dependencies:
description: "A list of helm repositories required to verify dependencies in the format '<name>,<url>;<name>,<url>'"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -71,3 +74,4 @@ runs:
- ${{ inputs.chart_version }}
- ${{ inputs.index_dir }}
- ${{ inputs.enterprise_url }}
- ${{ inputs.dependencies }}
11 changes: 11 additions & 0 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ APP_VERSION=${12}
CHART_VERSION=${13}
INDEX_DIR=${14}
ENTERPRISE_URL=${15}
DEPENDENCIES=${16}

CHARTS=()
CHARTS_TMP_DIR=$(mktemp -d)
Expand Down Expand Up @@ -93,6 +94,7 @@ main() {

locate
download
get_dependencies
dependencies
if [[ "$LINTING" != "off" ]]; then
lint
Expand Down Expand Up @@ -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}"
Expand Down