Skip to content

Commit 98822d9

Browse files
authored
Merge pull request #161 from minrk/publish-new-chart
fix check for first-time publishing chart
2 parents f8282ba + 2783b3f commit 98822d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

chartpress.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,11 @@ def publish_pages(
830830
if os.path.isfile(os.path.join(checkout_dir, "index.yaml")):
831831
with open(os.path.join(checkout_dir, "index.yaml")) as f:
832832
chart_repo_index = yaml.load(f)
833-
published_charts = chart_repo_index["entries"].get(chart_name)
833+
published_charts = chart_repo_index["entries"].get(chart_name, [])
834834

835-
if any(c["version"] == chart_version for c in published_charts):
835+
if published_charts and any(
836+
c["version"] == chart_version for c in published_charts
837+
):
836838
if force:
837839
_log(
838840
f"Chart of version {chart_version} already exists, overwriting it."

0 commit comments

Comments
 (0)