Skip to content

Commit 379bb9d

Browse files
authored
ci: skip helm repo priming if no chart deps exist (#67)
Signed-off-by: Tyler Gillson <[email protected]>
1 parent 51d485b commit 379bb9d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,21 @@ jobs:
110110
id: prime-helm-repos
111111
run: |
112112
set -e
113+
114+
dependency_count=$(yq eval '.dependencies | length' ${{ inputs.repo }}/charts/${{ inputs.repo }}/Chart.yaml)
115+
if [[ "$dependency_count" -lt 1 ]]; then
116+
echo "No dependencies found in Chart.yaml. Skipping helm repo operations."
117+
exit 0
118+
fi
119+
113120
yq eval '.dependencies[] | .name + " " + .repository' ${{ inputs.repo }}/charts/${{ inputs.repo }}/Chart.yaml | while read -r repo_name repo_url; do
114121
if [[ ! "$repo_url" =~ ^(oci://|file://) ]]; then
115122
helm repo add "$repo_name" "$repo_url"
116123
else
117124
echo "Skipping repository $repo_url for $repo_name"
118125
fi
119126
done
127+
120128
helm repo update
121129
helm dependency update ${{ inputs.repo }}/charts/${{ inputs.repo }}
122130

0 commit comments

Comments
 (0)